flow-manager
Flow Manager
Purpose
Manage flows (customer journeys/campaigns) -- create, update, delete flows and manage their steps including delays, exports, conditionals, A/B tests, and affinity routing.
Environment
Requires authenticated API access. See ../references/auth.md for credential resolution.
API Endpoints
List Flows
curl -s "${LYTICS_API_URL:-https://api.lytics.io}/v2/flow/ui" \
-H "Authorization: ${LYTICS_API_TOKEN}"
Get Flow
curl -s "${LYTICS_API_URL:-https://api.lytics.io}/v2/flow/ui/${FLOW_ID}" \
-H "Authorization: ${LYTICS_API_TOKEN}"
Get Flow Version
curl -s "${LYTICS_API_URL:-https://api.lytics.io}/v2/flow/ui/${FLOW_ID}/${VERSION}" \
-H "Authorization: ${LYTICS_API_TOKEN}"
Create Flow
curl -s -X POST "${LYTICS_API_URL:-https://api.lytics.io}/v2/flow/ui" \
-H "Authorization: ${LYTICS_API_TOKEN}" \
-H "Content-Type: application/json" \
-d '{ ... flow payload ... }'
Update Flow
curl -s -X POST "${LYTICS_API_URL:-https://api.lytics.io}/v2/flow/ui/${FLOW_ID}" \
-H "Authorization: ${LYTICS_API_TOKEN}" \
-H "Content-Type: application/json" \
-d '{ ... updated flow payload ... }'
Delete Flow
curl -s -X DELETE "${LYTICS_API_URL:-https://api.lytics.io}/v2/flow/ui/${FLOW_ID}" \
-H "Authorization: ${LYTICS_API_TOKEN}"
Create Work for Flow Step
curl -s -X POST "${LYTICS_API_URL:-https://api.lytics.io}/v2/flow/ui/${FLOW_ID}/step/${STEP_ID}/work" \
-H "Authorization: ${LYTICS_API_TOKEN}" \
-H "Content-Type: application/json" \
-d '{ ... work config ... }'
List Flow States
curl -s "${LYTICS_API_URL:-https://api.lytics.io}/v2/flow/state" \
-H "Authorization: ${LYTICS_API_TOKEN}"
Flow Payload
{
"id": "flow_name",
"label": "Display Name",
"description": "What this flow does",
"entry_segment_id": "segment_id",
"entry_condition": "on_segment_entry",
"reentry_allowed": false,
"reentry_delay": "24h",
"state": "draft",
"steps": [
{
"id": 1,
"label": "Step 1",
"type_hint": "work_export",
"slug": "step_1",
"next": 2,
"work_id": "work_id",
"work_config": {}
},
{
"id": 2,
"label": "Wait 24 hours",
"type_hint": "delay",
"slug": "delay_step",
"next": 3,
"delay": "24h"
}
]
}
Flow States
| State | Description |
|---|---|
draft |
Editable, not processing |
running |
Actively processing users |
draining |
Stopping gracefully, processing remaining users |
deleted |
Soft deleted |
Entry Conditions
| Condition | Description |
|---|---|
in_segment |
Triggers for users currently in the segment |
on_segment_entry |
Triggers only when a user enters the segment |
Step Types
| Type | Description | Key Fields |
|---|---|---|
work_export |
Export to external system | work_id, work_config |
delay |
Wait before next step | delay (duration string) |
conditional |
Split by FilterQL condition | split_conditions |
affinity |
Route by content affinity | split_affinities, affinity_config_id |
ab_testing |
Random split by probability | split_probabilities |
work_export_exit |
Export on flow exit | work_id, work_config |
Behavior
For Read Operations
Execute immediately, display flow structure as a visual step chain.
For Write Operations
Use the confirmation-gate pattern. For state changes (draft -> running, running -> draining), explicitly warn about the implications.
Error Handling
- Invalid entry segment: Verify segment exists first
- Invalid step references: Ensure
nextIDs point to existing steps - State transition errors: Only valid transitions are draft->running, running->draining
Dependencies
- Uses:
../references/auth.md,../references/api-client.md,../references/confirmation-gate.md - Related:
segment-manager skill(for entry segments),job-manager skill(for work steps)
More from lytics/agent-skills
entity-lookup
Look up user profiles by identity field and value. Use when the user wants to find or look up a specific user profile by email, user ID, or other identity field.
28audience-advisor
Strategic audience guidance -- helps users build the right audience for their business goal or improve an existing segment. Use when the user needs help choosing the right audience strategy, wants advice on segment design, or needs to improve an existing segment.
28integration-setup
Guided setup for data integrations -- connection, auth, and job creation. Use when the user wants to set up, configure, or connect a new data integration end-to-end.
28audience-snapshot
Analyze what an audience looks like -- demographic breakdowns, top field values, coverage rates, and distributions. Use when the user wants to understand audience composition, view segment demographics, or analyze field coverage for a segment.
28data-health-monitor
Single-command data health check -- streams, jobs, schema, and quota status in one report. Use when the user wants to check data health, view system status, or get an overview of streams, jobs, and schema health.
28schema-manager
Browse and modify schema fields, mappings, identity config, and field rankings. Use when the user wants to list, view, create, or modify schema fields, mappings, identity configuration, or field rankings.
27