Skip to main content
A three-agent research-and-report pipeline with hard ceilings on tokens, cost, and duration. When the ceiling is hit, remaining nodes are skipped instead of running — the workflow finishes with a successful status but partial output. This is the safer default for unattended production workloads.

What it demonstrates

  • The top-level budget: block
  • on_exceeded: skip_remaining — the workflow finishes cleanly instead of crashing
  • Per-node max_tokens_per_call — each agent’s response is independently bounded
  • The budget block embedded in the run summary, so callers can see how close they came to each ceiling

Run it

The --trace flag prints the full JSON trace, including the new summary.budget block:

Workflow

docs/cookbook/budget-guarded/workflow.yaml

on_exceeded actions

Per-node max_tokens_per_call

max_tokens_per_call is forwarded to the provider as the max_tokens API parameter so the model truncates its own response. Combined with the workflow budget, this gives you two layers of protection: each individual call is bounded and the cumulative spend is bounded.

Graph

Next steps

Content Approval

Pause for a human reviewer mid-workflow.

Guardrails

Per-call guardrails like injection detection and PII redaction.