How workflows work
- Client sends
POST /v1/agents/{name}/workflowto start a workflow - The workflow executes steps sequentially
- A step can pause the workflow with a
pendingActionrequesting external input - Client resumes with
POST /v1/workflow-runs/{runId}/resume - The workflow continues from where it paused
Starting a workflow
Description of the task for the workflow to execute.
Initial state passed into the workflow. Available to all steps.
Workflow response
When a workflow pauses, the response includes the current progress, completed steps, and the pending action requiring input.Current workflow status:
running, paused, completed, or failed.Array of completed and in-progress steps with their names, statuses, and outputs.
Final result when the workflow completes.
null while the workflow is still running or paused.Present when
status is paused. Describes what input is needed to continue.Unique identifier for this workflow run. Use it to resume, check status, or cancel.
Resuming a workflow
Provide the pending step name and the user’s input to continue execution.The name of the paused step to resume.
The external input for the paused step. Must match one of the
options if the pending action specifies them.Workflow statuses
| Status | Description |
|---|---|
running | Workflow is actively processing steps |
paused | Waiting for external input via pendingAction |
completed | All steps finished successfully |
failed | Terminated with an error |
Using the SDK
Managing workflow runs
| Endpoint | Description |
|---|---|
GET /v1/workflow-runs | List all workflow runs for the project |
GET /v1/workflow-runs/{runId} | Get current status and step details |
DELETE /v1/workflow-runs/{runId} | Cancel a running or paused workflow |
POST /v1/workflow-runs/{runId}/resume | Resume a paused workflow with input |
Best for
- Approval flows requiring human sign-off
- Human-in-the-loop processes where AI suggests and humans decide
- Multi-step pipelines with checkpoints
- Long-running processes that need external input at specific stages