Skip to main content
PhasedFanOutWorkflow hands the design of a multi-agent run to a lead agent. The lead plans phases, each phase’s steps run in parallel, a step can start one agent per item an earlier step found, and the lead combines what comes back. It is inspired by the dynamic workflows in Anthropic’s Claude Managed Agents. Reference: PhasedFanOutWorkflow.

Prerequisites

Find bugs, then verify each one

The lead decides the plan. A typical plan has one finder agent per file, then one fresh verifier per reported bug, so no bug is confirmed by the agent that reported it.
Put everything the workers need in the task. Workers see only their own prompt, and the plan reaches the task’s material through the {task} placeholder.

Inspect what ran

Use only your own agents

With allow_inline_agents=False, the lead can only plan with the agents you pass. It sees each agent’s agent_name and agent_description and decides how many copies of each to run.
Each step gets a fresh copy of Clause-Reader or Clause-Checker, so four readers never share a conversation.

Set the limits

Handle failures

A failed fan-out item becomes None and the run continues. A failed single step, an exhausted plan budget, or a fan-out past max_agents raises PhasedFanOutWorkflowError.

See the whole run

Set output_type="dict" to get every step’s output alongside the plan and the answer:
The rows are the task, the plan, one row per step named {phase title} / {step id}, and the lead’s answer.

Tips

  • Say how to split the work. “One agent per file, then one agent per bug” gives the lead a shape to plan around.
  • Use a strong lead and cheaper workers. The lead’s plan decides the run’s quality; workers do narrow tasks.
  • Keep size_guideline and max_agents apart. The guideline steers the plan; max_agents is the hard stop.