Overview
Learn how workflows orchestrate multi-step processes with agents, tools, and human actions.
Workflows are automated sequences that connect multiple steps into a cohesive process. Unlike single agent calls, workflows can branch, loop, pause for human input, and coordinate complex multi-step operations.
When to Use Workflows
Use workflows when you need to:
- Orchestrate multiple agents or tools in sequence
- Include human approval or input steps
- Branch logic based on conditions
- Handle long-running processes that may span hours or days
- Track execution progress step-by-step
Use agents directly when you need:
- Single-turn question/answer interactions
- Simple tool calls without orchestration
- Real-time streaming responses
Workflow Steps
Workflows consist of steps connected by edges. Each step performs a specific action:
| Step Type | Description |
|---|---|
collect-inputs | Gather inputs from users via form or SMS |
call-llm | Call an LLM with structured output |
call-tool | Invoke a tool and capture results |
call-agent | Call an agent with structured output |
call-api | Make HTTP API calls to external services |
call-workflow | Execute another workflow (nested workflows) |
request-user-action | Pause for human approval or decision |
end-flow | Conclude the workflow |
Workflow Lifecycle
Workflows have these statuses:
draft | testing | published | archived| Status | Description |
|---|---|
draft | In development, can be edited |
testing | Reserved for testing workflows |
published | Available for production use |
archived | Soft-deleted, hidden from lists |
The current API creates workflows as draft, can mark a workflow as published, and can archive or unarchive workflows. Archived workflows can be restored with the unarchive endpoint. Permanent deletion is only available for archived workflows.
Execution Model
Workflows execute on a Temporal backend, providing:
- Durability - Workflows survive server restarts
- Pause/Resume - Wait for human input indefinitely
- Step Tracking - Monitor progress in real-time
- Error Handling - Automatic retries and failure recovery
Workflows can be executed synchronously (blocking until complete) or asynchronously (return immediately, poll for status).