Skip to main content

Worked sequences

The endpoint list below documents each operation’s parameters, but three calls define how a flow behaves once the graph is saved: the trigger configuration you set at creation, a run with a real action payload, and activation (publish + enrol a subject). These sequences show each one with the body you send and the body the API returns.

Sequence 1 — configure the trigger

Set the trigger when you create the flow. trigger_type is one of manual (run on demand), webhook, schedule, event, or workflow. A schedule trigger also needs a 5-field cron_expr and optionally an IANA cron_tz (UTC otherwise) — create a schedule flow without a parseable expression and the API rejects it with a 422.
201

Sequence 2 — run the flow with a real action payload

Trigger one run and pass the context your nodes read. trigger_data is merged into the execution’s trigger context, so a node template like {{order_total}} resolves at run time. The run is accepted asynchronously (202); poll the executions log when you need the outcome.
202
When the fan-out you want is a contact or a list rather than raw context, use POST /api/v1/flows/{id}/start below — it merges your context the same way but also records which subject was enrolled.

Sequence 3 — publish, then enrol a subject

Nothing executes until the flow is published. Publish freezes the current definition as an immutable version; from then on /start and inbound triggers execute it. The publish response returns the flow with its new status and current version.
200
Then enrol one contact (pass list_id instead to fan out across a small list). The response tells you which mode ran and, for a single contact, the execution row it created:
202
Send list_id instead and the response reports the list fan-out — how many members were attempted and how many enrolled:
202
To take the flow back out of live execution, POST /api/v1/flows/{id}/unpublish returns it to draft; only a published flow can be unpublished (409 otherwise).