Workflow Engine
Parallel graph execution with variable passing and human-in-the-loop.
The Workflow Engine executes the step graph produced by the Orchestrator. It resolves dependencies, runs independent steps in parallel, threads data between steps through a shared context, and supports pausing for human review.
What a step carries
| Field | Meaning |
|---|---|
id | Unique step identifier |
agent | The capability group that owns the tool |
action | The tool to invoke |
args | Inputs; may contain $key variables |
depends_on | Steps that must complete first |
outputs | Values this step produces |
retry | How many times to retry on failure |
timeout | Maximum time the step may run |
needs_human | If true, pause for review before executing |
persona | Optional specialized role |
Execution model
Scheduling
Steps whose dependencies are all satisfied become ready and are dispatched together.
Parallel dispatch
Ready steps run concurrently, up to a sensible bound (a handful at a time).
Variable substitution
Before a step runs, $key references in its inputs are replaced with values produced by
earlier steps.
Execute & record
The tool runs; its result, outputs, and status are recorded.
Shared context & variable passing
Steps communicate through a shared key/value context. A step declares what it produces in
outputs, and downstream steps consume those values with $key in their inputs:
[
{ "id": "s1", "agent": "web_search", "action": "SEARCH_WEB",
"args": { "query": "AI news" }, "outputs": ["results"] },
{ "id": "s2", "agent": "email", "action": "SEND_EMAIL",
"args": { "to": "$user_email", "body": "$results" },
"depends_on": ["s1"] }
]Common ambient variables like $user_name and $user_email are resolved from the shared
context too.
Human-in-the-loop
A step marked needs_human pauses before executing, surfacing the workflow for review.
Workflows can be interrupted and resumed via the Workflows API:
| Endpoint | Action |
|---|---|
POST /api/workflows/{id}/interrupt | Pause a running workflow |
POST /api/workflows/{id}/resume | Resume a paused workflow |
POST /api/workflows/{id}/intervene | Inject human input / edits |
Resilience
- Retries β each step retries on failure up to its configured limit.
- Timeouts β each step is bounded by a maximum run time.
- Runtime capability creation β if a step's tool is still missing at execution time, the engine can create it as a safety net.
History
Completed workflows are saved locally and exposed via GET /api/workflows and
GET /api/workflows/{id}. Recurring/scheduled workflows are managed automatically β see the
Workflows API and Automation.