Orchestrator–Workers
Also known as: lead agent and subagents, manager pattern, dynamic delegation
- Who decides
- A manager agent
- Shape
- Fan-out
Intent
A lead model reads the request, decides which subtasks it needs, and hands each one to a worker that starts with an empty context. The model decides this split for each request at run time, not the developer in code, and the lead merges the results or plans another round.
About the name. Many sources use “orchestrator” and “supervisor” for the same thing. On this site an orchestrator plans a batch of new subtasks at run time, while a supervisor picks one worker from a fixed roster at every step.
Problem
A platform team is building an internal assistant for tooling questions. A developer asks: “Compare Vitest, Jest and node:test for our TypeScript monorepo (about 1,200 test files, on Jest today), and recommend one.”
The first version is a single agent with web search and read access to the repository. It reads docs, benchmarks, migration guides and the repository’s config files one after another, all in one conversation, then writes the report. Three things go wrong:
- The context fills up. Every page it reads stays in the conversation. By the time it reaches node:test, the Vitest pages from the start are buried or truncated, and the report covers the three runners in uneven depth.
- It is slow. It researches one runner after another, although the three investigations do not depend on each other.
- One prompt does every job. Search strategy, judging sources, reading the codebase and writing the report all share one prompt, with every tool loaded at once.
A fixed pipeline with one research step per runner does not help either. The next question (“audit every route handler for missing auth checks”) needs a different split, and nobody knows that split before the request arrives.
Solution
Split the work between a lead, the orchestrator, and workers. The lead plans, writes briefs and merges results, and does little reading itself. Each worker gets one brief, an empty context, a few tools and a budget, runs its own tool loop, and returns a condensed result instead of its whole transcript.
On the test-runner question, a run looks like this:
- Plan. The lead sees a comparison and decides on four subtasks: one per runner (CI speed, features, ecosystem), plus an inventory of the Jest-specific APIs the monorepo uses, such as mocks and custom matchers.
- Brief. For each subtask it writes a self-contained brief: the objective, what the other workers cover (so the Vitest worker leaves Jest alone), which sources to prefer, a tool-call budget, when to stop and the format of the result.
- Dispatch. Runtime code starts the four workers in parallel. Three search the web; the fourth has read-only access to the repository.
- Work and return. A worker may read tens of thousands of tokens, but it sends back a short result: findings with their sources, conflicts between sources and open questions. Raw benchmark tables go to a file store, and only a reference comes back.
- Synthesize or loop. The lead merges the four results and notices a gap: no worker found a CI benchmark for a repository of this size. It starts one more worker to time node:test and Vitest on one package, then writes the recommendation itself.
The model decides how many workers to start and when the run is finished; runtime code enforces the caps. The nearest pattern, Parallelization, also fans work out, but there the developer fixes the split in code, while here a model writes the list of subtasks for each request.
Structure
Hover over a number, or tap it, to read what it is.
- Orchestrator, planning. Reads the task and decides how many workers it needs and what each one covers. Usually the strongest model.
- Brief. The only thing a worker receives from the lead: the objective, what is out of scope, sources and tools, a budget, when to stop and the result format.
- Workers. Each does one bounded subtask in its own context, often as a ReAct loop with a small toolset, possibly on a cheaper model.
- Result. A fixed shape for what comes back: a status, a short summary, findings with sources, conflicts, open questions and references to stored outputs.
- Artifact store. Storage for bulky outputs, which reach the lead as references instead of filling its context.
- Orchestrator, synthesis. Merges the results, flags contradictions and spots gaps. Only the lead writes the final answer.
- Another round. When something important is missing and budget remains, the lead writes new briefs instead of answering.
- Runtime. Plain code that starts the workers and enforces limits on their number, time, rounds and tokens.
Use it when / Avoid it when
Use it when
- You cannot predict the subtasks. Their number and content depend on the request, as in research or exploring a large codebase.
- The work splits into independent parts. Each part fits in a worker’s context even when the whole job does not fit in one.
- The work is mostly reading. Workers that only gather information rarely get in each other’s way.
- The answer is worth the tokens. Anthropic reports that its multi-agent research system uses about 15 times the tokens of a chat interaction.
Avoid it when
- The subtasks are always the same. Use Parallelization or a prompt chain, which fix the split in code and are cheaper to test.
- Each step needs the result of the previous one. Use a single ReAct agent or Plan-and-Execute; parallel workers would only wait for each other.
- Several workers would write the same artifact. Use one agent for every write, with workers that only research or review.
- The conversation goes on and the specialist changes each turn. Use a Supervisor or Swarm / Handoffs, which pick the next agent at every turn.
How it fails
- Over-spawning
-
The lead starts a dozen workers for a simple question, and the cost of the run explodes.
Mitigation: give the lead effort rules (one worker for a simple fact, a few for a comparison) and enforce a hard cap on workers in code.
- Duplicate work
-
Two workers research the same thing from vague briefs, while another part of the question goes uncovered.
Mitigation: say in every brief what the other workers cover and what is out of scope.
- Conflicting decisions
-
Outputs that each look fine do not fit together, because each worker made its own assumptions.
Mitigation: keep the writing in one agent and put the shared decisions in every brief.
- Lost detail
-
A number or a caveat disappears when a worker condenses its findings for the lead.
Mitigation: have workers store large outputs and return references, which the lead reads when precision matters.
Related patterns
- Parallelization: the developer fixes the split in code; many orchestrator–workers systems are parallelization over a work list that a model wrote.
- Supervisor: the same hub shape, but it picks one worker per step from a fixed roster and gets control back after each one.
- Plan-and-Execute: one agent plans and runs the steps in its own context, while here separate workers carry out the plan, often in parallel; the two are often combined.
- Hierarchical teams: orchestrator–workers nested over several levels, where some workers are orchestrators themselves.
Try it
Describe the requests your system handles and the worker types the lead can start. The generator writes two system prompts: one for the orchestrator, and one shared by the workers with the result format.
Open the generator on this pattern
Further reading
- Building effective agents (Anthropic, 2024): the orchestrator–workers workflow and how it differs from parallelization.
- How we built our multi-agent research system (Anthropic, 2025): a lead and its subagents in production, with briefs, effort rules and token costs.
- Don’t Build Multi-Agents (Cognition, 2025): the case against parallel workers that write, and why shared context matters.