Fan-Out
Run multiple agents in parallel and merge their results downstream
Fan-Out
The fan-out pattern sends work to multiple agents simultaneously. All parallel agents run at the same time, and their results feed into a downstream agent that merges or synthesizes the output.
When to Use Fan-Out
- Code review — run a style analyzer and a security scanner at the same time
- Research — gather information from multiple sources in parallel
- Validation — check compliance, security, and quality simultaneously
- Any workflow where independent checks or analyses can run concurrently
Fan-out is the right choice when multiple agents can work on the same input without depending on each other. If agents need to run in sequence, use pipeline instead.
How It Works
Agents that share the same phase number and appear in a fan-out bracket [...] in the flow block run in parallel. A downstream agent waits for all parallel agents to complete before starting.
topology review-system : [fan-out] {
meta {
version: "1.0.0"
description: "Parallel code analysis with merged results"
}
orchestrator {
model: opus
handles: [intake, create-report]
}
agent analyzer {
model: sonnet
phase: 1
tools: [Read, Grep, Glob]
outputs: { risk-level: low | medium | high | critical }
}
agent security-scanner {
model: sonnet
phase: 1
tools: [Read, Grep]
outputs: { has-vulnerabilities: yes | no }
}
agent summarizer {
model: sonnet
phase: 2
tools: [Read, Write]
}
flow {
intake -> [analyzer, security-scanner]
analyzer -> summarizer
security-scanner -> summarizer
summarizer -> create-report
}
}Key Concepts
Parallel Brackets
The bracket syntax [agent-a, agent-b] signals parallel execution:
flow {
intake -> [analyzer, security-scanner]
}Both analyzer and security-scanner receive the input at the same time and run independently.
Fan-In (Merging Results)
The downstream agent implicitly waits for all upstream parallel agents to finish. When both analyzer and security-scanner have completed, summarizer receives all of their outputs:
flow {
analyzer -> summarizer
security-scanner -> summarizer
}Shared Phase
Parallel agents should share the same phase number. The downstream agent uses a higher phase number:
agent analyzer { phase: 1 }
agent security-scanner { phase: 1 }
agent summarizer { phase: 2 }Flow Diagram
+--> analyzer -------+
| |
intake -------+ +--> summarizer -> create-report
| |
+--> security-scanner+Combining with Other Patterns
Fan-out works well with:
- pipeline — fan-out within a specific phase of a larger pipeline
- human-gate — require approval after parallel results are merged
- supervisor — let an orchestrator decide which agents to fan out to based on the task