Docs/API Reference/Workflow

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.

classmeshflow.Workflow

Parameters

ParameterTypeRequiredDescription
cost_capCostCapoptionalHard spending limit in USD. Defaults to a $5 policy budget when omitted.
modestroptional"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.