step
segment
Execute Segment analytics operations.
Overview
Execute Segment analytics operations.
Supports operations: - track: Record user actions - identify: Record user traits - page: Record page views - screen: Record mobile screen views - group: Associate user with a group
Setup: 1. Create a Segment account at https://segment.com/ 2. Create a source in your Segment workspace 3. Copy the Write Key from your source settings 4. Store your write key securely (e.g., as an environment variable: SEGMENT_WRITE_KEY)
Write Key: Required. Get from Segment source settings
Configuration
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | No | Step type identifier
Default: "segment" |
write_key | string | Yes | Segment source write key (API key) for authentication |
operation | string | Yes | Segment operation: track (events), identify (user traits), page (page views), group (group traits), or screen (mobile screens)
Options: track, identify, page, group, screen |
user_id | string | No | Unique identifier for the user (required unless anonymous_id is provided) |
anonymous_id | string | No | Anonymous identifier for the user (alternative to user_id for unknown users) |
event | string | No | Name of the event being tracked (required for track operation) |
properties | string | No | Additional properties for the event, page, or screen (custom metadata) |
traits | string | No | User or group traits/attributes (for identify and group operations) |
category | string | No | Category of the page or screen (for page and screen operations) |
group_id | string | No | Unique identifier for the group (required for group operation) |
context | string | No | Additional context about the event (device, app, location, etc.) |
timestamp | string | No | ISO 8601 timestamp when the event occurred (defaults to current time if not provided) |
timeout | integer | No | HTTP request timeout in seconds
Default: 30 |
output_to | string | No | Key name where the API response will be stored in the event
Default: "segment" |
Base Configuration
These configuration options are available on all steps:
| Parameter | Type | Default | Description |
|---|---|---|---|
name | | null | Name of the page or screen (for page and screen operations) |
description | | null | Optional description of what this step does |
retries | integer | 0 | Number of retry attempts (0-10) |
backoff_seconds | number | 0 | Backoff (seconds) applied between retry attempts |
retry_propagate | boolean | false | If True, raise last exception after exhausting retries; otherwise swallow. |