Workflows API
The Workflows API lets you define and execute multi-step verification pipelines combining deterministic checks, AI mediators, and human approvals.
Step Types
assertRun verification checksmediatorAI-powered evaluationhuman_approvalHuman-in-the-loophttp_requestCall external APIstransformTransform dataconditionalBranch logicdelayWait for durationpollPoll until conditionEndpoints
Create a new workflow definition
Request Body
{
"name": "Content Review Pipeline",
"steps": [
{
"id": "format_check",
"name": "Check Format",
"type": "assert",
"config": {
"checks": [
{ "type": "word_count", "operator": "gte", "value": 500 }
]
}
},
{
"id": "ai_review",
"name": "AI Quality Review",
"type": "mediator",
"config": {
"mediator_id": "content-quality-v1",
"escalation_threshold": 0.7,
"timeout_seconds": 60
},
"depends_on": ["format_check"]
},
{
"id": "human_approval",
"name": "Final Approval",
"type": "human_approval",
"config": {
"prompt": "Please review this content",
"timeout_hours": 24,
"timeout_action": "escalate",
"options": [
{ "label": "Approve", "value": "approve", "outcome": "approved" },
{ "label": "Request Revisions", "value": "revise", "outcome": "rejected" }
]
},
"depends_on": ["ai_review"],
"condition": "$.ai_review.confidence < 0.9"
}
]
}Response
{
"data": {
"id": "wf_abc123",
"name": "Content Review Pipeline",
"version": 1,
"created_at": "2026-03-04T10:00:00Z"
}
}Run Status Values
pendingRun created, not yet startedrunningWorkflow is executingpausedWaiting for external inputawaiting_humanWaiting for human approvalcompletedAll steps completed successfullyfailedA step failed or timed out