v2
latestOpenAPI 3.1.12026-07-2613060964.2 KBCreate or Update Workflow
Create a new workflow or update the draft version of an existing one
post/v1/{workspace}/workflow/{slug}/
Path parameters
workspacestring required
Workspace where the workflow should be created (staging, production, etc.)
slugstring required
Unique identifier of the workflow. You can get it from workflow settings for existing workflows.
Query parameters
commitboolean
Whether to commit the workflow immediately. Workflow will be successfully committed only if validation_result.is_valid is true.
commit_messagestring
Commit message describing the changes (required if commit=true)
Request body
Example request
{
"name": "Welcome Sequence",
"category": "transactional",
"payload_schema": {
"schema": "onboarding-sequence-schema",
"version_no": 1
},
"ratelimit": {
"count": 4,
"sliding_window": "6m"
},
"conditions": [
{
"type": "expression_v1",
"expression_v1": {
"args": [
{
"op": "==",
"value": "\"admin\"",
"variable": "role",
"variable_ns": "$recipient"
}
]
}
}
],
"override_recipients_type": "user",
"override_recipients_user_expr": ".distinct_id",
"override_recipients_single_object_fields_expr": {
"id": ".object_id",
"object_type": ".object_type",
"$object_subscriptions_query.depth": "2"
},
"override_actor_user_expr": ".actor_id",
"override_tenant_expr": ".tenant_id",
"tree": {
"nodes": [
{
"name": "Wait 30 minutes",
"relative_to": {
"pivot_expr": ".start_time"
}
}
]
}
}Response
The response includes the same workflow object as input along with a validation_result field that indicates whether the workflow configuration is valid.