Supervisor / Worker Orchestration

8 min read

G3
Deep Dive · Multi-Agent Systems

Supervisor / worker orchestration: the pattern that actually ships.

Two settings decide whether a supervisor/worker system beats one agent with tools, and in the library most teams reached for, both of them default to copying everything: a handoff passes the supervisor's full message history down to the worker, and the join can pass each worker's full transcript back up. Isolation at both ends is the entire reliability argument for this topology, so the default configuration buys a single agent's quality at a star's price — and the flag you have never read moves your usable fan-out by more than an order of magnitude.

Step 1The control flow is plan → dispatch → join → aggregate, and two of those arrows are the whole design.

The supervisor holds the task and the plan; workers hold only their slice. The loop: the supervisor decomposes the task into subtasks, dispatches each to a fresh worker with a scoped instruction, joins on the results (waiting for the slowest), and aggregates into a single answer — possibly re-planning if the result is thin. Workers never see each other; all coordination is mediated by the supervisor. That mediation is the pattern's strength (one place for policy) and its ceiling (one place to overload).

# supervisor/worker: scoped dispatch, central aggregate
def supervise(task, budget):
    plan = supervisor.decompose(task)
    jobs = [dispatch(w, sub, budget / len(plan)) for sub in plan]
    done = join(jobs)                         # waits on the slowest
    return supervisor.aggregate(task, done)   # may re-plan if thin

Written as four verbs it reads like a scheduling problem, and that framing is why teams argue about topology — star versus hierarchy versus swarm — when the decisions that determine the outcome are not in plan or join at all. They are in what dispatch puts into the worker's context window, and what join puts back into the supervisor's. Those two payloads are configuration, they have defaults, and the defaults are generous.

Step 2The dispatch payload: the reliability claim, and the default that cancels it.

The argument for this topology has never been that more agents are smarter. It is that a worker which sees only its subtask and the minimal context for it is harder to distract, cheaper per call, and a smaller prompt-injection surface. Leak the full task and sibling outputs into every worker and you re-couple them, inflate every context window, and reintroduce the groupthink you split to avoid.

Now read the implementation. langchain-ai/langgraph-supervisor-py — 1,650 stars, MIT, the dedicated library for this pattern in the framework most associated with it — builds handoffs with create_handoff_tool, and by default a handoff passes the full message history from the supervisor to the receiving agent, plus a tool message confirming the handoff. add_handoff_messages also defaults to True, so the handoff invocations themselves accumulate in state; the README notes that setting it to False produces a more concise history.

So the out-of-the-box behaviour of the most-used supervisor implementation is the thing the pattern exists to avoid. That is not a bug — passing history is the right default for a handoff, where one agent takes over a conversation and needs to know what was said. It is the wrong default for a worker, and the library is used for both.

The repository was archived with its last push on 15 July 2026, and its README now says: "We now recommend using the supervisor pattern directly via tools rather than this library for most use cases," pointing at LangChain's multi-agent and supervisor guides. Read that carefully — it does not fix the default, it relocates the decision into your own code. Hand-rolling the dispatch means you choose the payload explicitly, which is better, and it also means nobody chooses it for you when you forget.

Treat the worker boundary as a hard interface: scoped instruction in, structured result out, nothing else crosses. Whichever framework you use, the test is empirical — print the first message a worker receives and count its tokens. If it contains the supervisor's planning deliberation, you are paying for a fan-out and getting a broadcast. What a sub-agent actually inherits works through the four other inheritance decisions hiding behind this one, including the one no framework exposes: authority.

Step 3The join payload sets your fan-out, and you can compute the number.

The supervisor's context window is the scarce resource in this topology, and the constraint that binds is not planning — writing eight subtasks is cheap — but reconciling eight results in one window. That makes your usable fan-out an arithmetic problem with four inputs, three of which you control.

# the reconcilable width, in tokens
usable     = 120_000   # effective context, not the advertised number
prefix     = 8_000     # system prompt + tool definitions
plan       = 2_000     # the structured plan the supervisor wrote

per_report = 1_500     # compact structured artefact per worker
width      = (usable - prefix - plan) // per_report   # = 73

per_report = 40_000    # output_mode="full_history": whole transcript
width      = (usable - prefix - plan) // per_report   # = 2

The flag is real: create_supervisor takes output_mode="full_history", which includes the full message history from each worker agent, or output_mode="last_message", which includes only the worker's final response. One keyword argument moves the context ceiling on your fan-out by more than an order of magnitude, and it is not the kind of setting that appears in an architecture review.

Two honest caveats on the arithmetic. The 73 is not a recommendation — cost and latency bite long before context does, and the fan-out tax shows the latency win flattening after about three branches while the prefix term keeps climbing. And usable is doing quiet work: the number to put there is the context length over which your model still reconciles reliably, not the one on the spec sheet, which effective versus advertised context shows is often a fraction of it. The point of the calculation is not the answer; it is that the answer changes by 36× depending on a default you can read in thirty seconds.

Step 4Decomposition quality sets the ceiling on everything downstream.

A bad split cannot be rescued by good workers. The supervisor must produce subtasks that are independent (no branch needs another's intermediate state — otherwise you have a disguised pipeline), scoped (each instruction is concrete enough that a context-isolated worker cannot drift), and budgeted (each carries a token and step ceiling so fan-out cannot run away). The single most common production defect is vague subtasks: "research the market" spawns a worker with no stopping condition that burns its budget and returns mush.

The shape of the split also decides whether fan-out helps at all, and this is measured rather than argued. Google's controlled study of multi-agent wirings found the same topologies gaining up to 80.8% on parallel financial reasoning and losing 39–70% on sequential planning — the same graph, opposite signs, selected entirely by whether the task decomposed. Fan out reads; keep coupled writes in one agent. Multi-agent topologies has the full result.

Make the supervisor emit subtasks as a structured plan object — id, instruction, success criterion, budget — not as free prose it then re-parses. The success criterion is what lets a worker know it is done instead of looping until the budget is gone, and it is also the only thing that makes a worker's report compact enough to join: a worker answering a specific question returns an answer, while a worker given a topic returns a transcript.

Step 5Aggregation is a synthesis step, and the supervisor is the only component with no success criterion of its own.

Joining results is where multi-agent value is realised or lost. The naive aggregator pastes worker outputs together and returns them — which surfaces every contradiction between workers and every unfilled gap, pushing the real work onto the reader. A real aggregator reconciles: detects conflicting worker claims, resolves or flags them, fills gaps with a re-dispatch, and produces one coherent artefact. Critically, the aggregator must not have to re-derive what the workers did. If it does, the decomposition failed and you paid fan-out cost for nothing.

"Aggregate" implemented as string concatenation is the most common silent failure of this pattern. It passes demos — workers rarely conflict on toy inputs — and fails in production the first time two workers disagree, when the system confidently returns both contradictory answers stitched together.

There is a second asymmetry worth naming. Every worker gets a success criterion from the supervisor; the supervisor's own stopping condition is "the aggregate looks complete", judged by the same model instance that wrote the plan. That is a self-assessment by the component with the strongest incentive to declare victory, which is the generator–verifier gap appearing at the top of the tree rather than the bottom. Give the run a completion decision taken by something other than the agent claiming to be finished, and a shared budget ledger rather than per-agent caps that multiply under fan-out — terminating a multi-agent run has the three exits worth distinguishing.

Step 6When the star is the wrong shape.

The upside is not in dispute: Anthropic's published write-up of its multi-agent research system reported the multi-agent configuration beating a single Claude Opus 4 agent by 90.2% on an internal research eval, at roughly 15× the token usage of a chat interaction, with token usage alone explaining about 80% of performance variance. Both halves of that are the pattern's case — it works, and it works by spending.

Skip it when the subtasks are not independent (you built a pipeline and called it a star); when the aggregation cannot be done without re-doing the workers' reasoning (the split bought nothing); when the task's value does not justify a 15× multiplier; or when fan-out is so wide that no single supervisor context can reconcile it, and a hierarchy's extra summarisation hop would corrupt the answer anyway. Supervisor/worker pays off exactly when decomposition is clean and aggregation is real synthesis — and both of those are properties of the two payloads, not of the diagram.

Before you tune a prompt, read four values out of your running system: the token count of the first message each worker receives, the token count of each worker's report, the share of the supervisor's join-time input those reports occupy, and your model's effective reconcile length. Set the dispatch payload to the scoped instruction only, set the join payload to final answers only, then cap the fan at the width that arithmetic gives you — or at three, whichever is smaller. Those four numbers settle more architecture arguments than any topology diagram, and none of them requires a framework change.

Related: when and when not to go multi-agent for the prior question, sub-agent patterns compared for handoffs versus agents-as-tools, and parallel writes and the silent merge for what happens when workers write instead of read.