Orchestration Patterns
A single agent can do a lot. But real systems need multiple agents working together. There are exactly four patterns for coordinating them — and choosing the wrong one is the most common multi-agent architecture mistake. This lesson teaches all four, when to use each, and when each one fails.
Why Orchestration Matters
Once you have more than one agent, you need a coordination strategy. Without one, agents step on each other, duplicate work, or sit idle waiting for input that never comes. The four orchestration patterns below cover every multi-agent scenario. Most real systems use a combination.
The Four Patterns
Here are the four patterns at a glance:
A → B → C. Sequential. Each agent's output becomes the next agent's input.
A → B, C, D. Parallel. One agent triggers many simultaneously.
S monitors A, B, C. Overseer watches workers and intervenes when needed.
All agents coordinate peer-to-peer. No hierarchy. Emergent behavior.
Deep Dive: Each Pattern
Each agent's output is the next agent's input. Like an assembly line — step 1 must finish before step 2 starts. Use when tasks have strict dependencies.
Real example: Content pipeline — Writer drafts → Editor reviews → Publisher deploys. Each step transforms the previous step's output.
Failure mode: If any step blocks, the entire pipeline stalls. A slow Editor means nothing gets published. Solution: add timeouts and fallback paths.
One event triggers multiple independent agents simultaneously. The key word is independent — if Agent B needs Agent C's result, this is not fan-out.
Real example: New blog post published → simultaneously: post to Twitter, send email newsletter, update RSS feed, notify Slack. Each action is independent.
Failure mode: When downstream results need to be merged or ordered. Fan-out is fire-and-forget. If you need to collect all results and combine them, use fan-out/fan-in (add a collector agent).
A dedicated overseer agent monitors workers and intervenes when they fail — restarting, reassigning, or escalating. The supervisor does not do the work; it manages those who do.
Real example: Five web scrapers run in parallel, each scraping different sites. A supervisor watches their health. When one crashes on a CAPTCHA, the supervisor retries with a different strategy or reassigns the URL to another scraper.
Failure mode: Single point of failure — if the supervisor itself crashes, nobody is watching the workers. Solution: make the supervisor stateless and restartable, or use a supervisor-of-supervisors.
All agents are equal. No central controller. Agents coordinate through shared state, passing tasks to whichever agent is available. Behavior emerges from their interactions. This is the most complex pattern — and the most resilient.
Real example: OpenAI's Swarm framework. A customer service system where any agent can handle any ticket. If the user's question shifts from billing to technical, the current agent hands off to a more specialized agent seamlessly.
Failure mode: Harder to debug and predict. Without a central coordinator, it is difficult to trace why a specific decision was made. Requires robust logging and clear agent boundaries.
Choosing the Right Pattern
Use this decision framework:
Yes → Pipeline
No → Are they triggered by the same event?
Yes → Fan-Out
No → Do agents need a central manager?
Yes → Supervisor
No → Swarm
Most production systems combine patterns. A supervisor might manage a pipeline of fan-out workers. The patterns are building blocks, not mutually exclusive.
This lesson is for Pro members
Unlock all 520+ lessons across 52 courses with Academy Pro.
Already a member? Sign in to access your lessons.