All workflow endpoints require a secret key (
sk_*).Workflow structure
A workflow consists of:- Trigger — the event name that starts the workflow (e.g.
signed_up) - Steps — an ordered set of actions to perform (send email, wait, conditional branch, etc.)
- Transitions — connections between steps that optionally include conditions
Step types
| Type | Description |
|---|---|
TRIGGER | Entry point created automatically. Not added manually. |
SEND_EMAIL | Sends an email using a saved template. |
DELAY | Pauses the execution for a fixed duration before proceeding. |
WAIT_FOR_EVENT | Pauses until a specific event is tracked for the contact, or a timeout elapses. |
CONDITION | Branches the execution based on a boolean expression evaluated against contact data or event data. |
WEBHOOK | Sends an HTTP request to an external URL with contact and event data. |
UPDATE_CONTACT | Updates the contact’s data fields with specified key-value pairs. |
EXIT | Terminates the workflow execution early for the contact. |
Execution statuses
| Status | Description |
|---|---|
RUNNING | The execution is actively processing steps. |
WAITING | The execution is paused on a DELAY or WAIT_FOR_EVENT step. |
COMPLETED | The execution finished normally. |
CANCELLED | The execution was manually cancelled. |
FAILED | The execution encountered an error. |
List workflows
GET /workflows
Returns a paginated list of workflows for the authenticated project.
Query parameters
Page number (1-indexed).
Items per page. Maximum
100.Filter workflows by name.
Example
Create workflow
POST /workflows
Creates a new workflow. The workflow is created in a disabled state — set enabled: true to activate it immediately.
Body parameters
Internal workflow name.
The event name that triggers this workflow (e.g.
signed_up, purchased). When this event is tracked for a contact, a new execution starts.Whether the workflow is active and will start new executions. Set to
true to enable on creation.When
true, a contact can enter the workflow again even if they have a previous completed or active execution. When false, a contact only runs through the workflow once.Optional description.
Example
Get workflow
GET /workflows/:id
Retrieves a single workflow with all of its steps and transitions.
Path parameters
The workflow ID.
Example
Update workflow
PATCH /workflows/:id
Updates workflow settings. To add or remove steps, use the step-specific endpoints below.
Path parameters
The workflow ID.
Body parameters
Workflow name.
Workflow description.
Enable or disable the workflow. Disabling stops new executions but does not cancel in-progress ones.
Allow contacts to re-enter the workflow.
Trigger type (advanced — typically
EVENT).Trigger configuration object (advanced).
Example
Delete workflow
DELETE /workflows/:id
Permanently deletes a workflow.
Path parameters
The workflow ID.
204 No Content on success.
Example
List executions
GET /workflows/:id/executions
Returns a paginated list of executions for a workflow.
Path parameters
The workflow ID.
Query parameters
Page number.
Items per page. Maximum
100.Filter by execution status. One of
PENDING, RUNNING, COMPLETED, CANCELLED, FAILED.Response
Array of execution objects.
Example
200
Cancel execution
DELETE /workflows/:id/executions/:executionId
Cancels a specific in-progress execution.
Path parameters
The workflow ID.
The execution ID to cancel.
Example
Cancel all executions
POST /workflows/:id/executions/cancel-all
Cancels all active executions (RUNNING or WAITING) for a workflow. Use this before editing a live workflow.
Path parameters
The workflow ID.
Example
Add step
POST /workflows/:id/steps
Adds a new step to a workflow. Steps are connected via transitions.
Path parameters
The workflow ID.
Body parameters
Step type. One of
SEND_EMAIL, DELAY, WAIT_FOR_EVENT, CONDITION, WEBHOOK, UPDATE_CONTACT, EXIT.Display name for the step.
Visual position in the workflow editor:
{ "x": 100, "y": 200 }.Step configuration. Shape varies by type:
SEND_EMAIL:{ "templateId": "uuid" }DELAY:{ "amount": 24, "unit": "hours" }WAIT_FOR_EVENT:{ "eventName": "email.clicked", "timeout": 86400 }CONDITION:{ "field": "contact.data.plan", "operator": "equals", "value": "pro" }WEBHOOK:{ "url": "https://...", "method": "POST", "headers": {} }UPDATE_CONTACT:{ "data": { "key": "value" } }EXIT:{ "reason": "optional reason" }
Template ID shorthand for
SEND_EMAIL steps. Equivalent to setting it in config.When
true, automatically creates a transition from the last step to this new step.Example
Update step
PATCH /workflows/:id/steps/:stepId
Updates a workflow step’s name, position, or configuration.
Path parameters
The workflow ID.
The step ID to update.
Body parameters
New display name.
New visual position:
{ "x": number, "y": number }.Updated step configuration.
Updated template ID (for
SEND_EMAIL steps).Delete step
DELETE /workflows/:id/steps/:stepId
Removes a step from the workflow. Any transitions connected to this step are also removed.
Path parameters
The workflow ID.
The step ID to delete.
204 No Content on success.
Create transition
POST /workflows/:id/transitions
Creates a directed connection between two steps.
Path parameters
The workflow ID.
Body parameters
ID of the source step.
ID of the destination step.
Optional condition that must be true for this transition to be followed. Used with
CONDITION steps to define branches.Order priority when multiple transitions exist from the same step. Lower values are evaluated first.
Delete transition
DELETE /workflows/:id/transitions/:transitionId
Removes a transition between two steps.
Path parameters
The workflow ID.
The transition ID to delete.
204 No Content on success.