Workflow
The Workflow class is the high-level synchronous wrapper for sequential agent workflows. It compiles agents into a governed Team and applies the requested cost cap and mode.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| cost_cap | CostCap | optional | Hard spending limit in USD. Defaults to a $5 policy budget when omitted. |
| mode | str | optional | "production" (default) or "sandbox". Sandbox mocks all LLM calls — zero API spend. |
Methods
.add(*agents)
Adds one or more Agent instances to the sequential workflow. Use Team(pattern="parallel") when you need fan-out/fan-in concurrency.
.run(task) → WorkflowResult
Executes the workflow. Returns a WorkflowResult with .output, .cost_usd, .tokens, .run_id, .paused_nodes, and .ledger_db.