AI Agent Builders & Citizen Developers
Strategic · M23 · lesson 23 of 32 · queued
Preview — browse every lesson free. Enroll to mark lessons complete, open partner links and save your progress. Login & enroll →
The Orchestrator-Worker Pattern in LangGraph, CrewAI, or Platform-Native
📖
now learning

The Orchestrator-Worker Pattern in LangGraph, CrewAI, or Platform-Native

15 min

The orchestrator-worker pattern is the multi-agent architecture every architect ships first and the one that fails in the same five ways every time. A router agent reads the input, decides which specialist should handle it, hands the work off, and stitches the responses back together. On paper, it is a clean separation of concerns. In production, it is a context-loss generator and a debugging nightmare unless you design the handoff explicitly. This lesson is the architect's working manual: when the pattern is the right answer (and when it is the wrong one), how to implement it in LangGraph, CrewAI, or a no-code stack like Lindy + Relevance AI + Vellum, and how to defeat the failure mode that kills 70% of orchestrator-worker rollouts in their first month — handoff loss, where the router's context never reaches the specialist and the specialist hallucinates the missing pieces. The pattern works. But only when you treat the handoff itself as a first-class artifact, not as an implementation detail.

What the Pattern Actually Is

The orchestrator-worker pattern, in one sentence: one agent picks who should answer; one or more specialist agents answer. The orchestrator is also called the router, the dispatcher, the planner, or the supervisor depending on the framework. The workers are also called specialists, sub-agents, skills, crew members, or tools. Names vary. Shape is constant.

Concretely, a single turn flows like this:

  1. User input arrives at the orchestrator.
  2. Orchestrator reads the input, optionally enriches it (retrieval, memory lookup, classification), and produces a routing decision: which specialist should handle this, with what context.
  3. Orchestrator hands the work to the chosen specialist along with a structured payload — the prompt, the relevant context, the tool permissions, the success criteria.
  4. Specialist runs its own loop (reasoning, tool calls, retrieval) and produces a response.
  5. Orchestrator receives the specialist's response, optionally validates, optionally calls another specialist (in chains or fan-out patterns), and returns the final result to the user.

The pattern is most often used when you have three to seven specialists, each tuned for a distinct domain — sales lookup, support escalation, billing question, technical answer, scheduling — and a single front door that does not know in advance which domain the user's question lives in.

The orchestrator's job is not to answer. Its job is to route correctly and to pass the right context. Get those two things right and the specialists will do the rest. Get them wrong and the specialists will confidently produce the wrong answers.

When Orchestrator-Worker Is the Right Pattern

Five signals justify the orchestrator-worker pattern. The next lesson covers when these signals are absent and a single smart agent is the better answer; for now, the signals that say yes.

1. Genuinely different tool sets per specialist

The billing specialist needs read-only access to Stripe and the customer database. The support specialist needs Zendesk read-write, Jira create-issue, and the knowledge base. The sales specialist needs Salesforce read-write and a calendar tool. If you collapsed these into a single agent, you would either give one agent every tool (blast-radius problem) or build conditional tool-permission logic that recreates the orchestrator from scratch. Different tool sets are the cleanest justification.

2. Different memory horizons

The triage specialist needs to remember the last 15 minutes. The billing specialist needs the last 90 days. The customer-success specialist needs the lifetime relationship. Trying to give a single agent all three horizons either bloats its context window or forces a single memory strategy that fits no specialist well. Distinct memory horizons map cleanly to distinct specialists.

3. Different governance regimes

The legal specialist's outputs need redteam review and citation requirements. The marketing specialist's outputs do not. The HR specialist's outputs need PII screening before they leave the agent boundary. If a single agent has to satisfy every governance rule the strictest specialist needs, you over-restrict the less-regulated work and ship slower across the board.

4. Independently versioned prompts and evals

Each specialist has its own eval set, its own prompt history, its own regression detection. The billing specialist team can ship a new prompt without waiting for the support specialist team's signoff. This is an organizational design choice that pays off when you have more than one team contributing to the agent stack.

5. Latency and cost gradients

The triage specialist runs on Claude Haiku 4 or GPT-4o-mini at 200ms median latency and 0.0006 dollars per call. The reasoning specialist runs on Claude Sonnet 4.5 at 1.4 seconds median and 0.04 dollars per call. Routing the 80% of queries that need the cheap fast specialist to the cheap fast specialist instead of to the reasoning specialist saves 60-85% on per-resolution cost.

If at least two of these signals are present, the orchestrator-worker pattern earns its complexity. If only one or zero are present, you are probably building it because it looks impressive in an architecture diagram and you will regret it within a sprint.

Implementing in LangGraph

LangGraph is the production default for stateful multi-agent orchestration in 2026 because it gives you durable execution, time-travel debugging, and a graph model that maps directly to the orchestrator-worker shape. The implementation has four parts.

The state schema

Every LangGraph agent is a graph over a typed state. The state is the shared context that flows between nodes. For an orchestrator-worker graph, the state typically holds:

  • messages — the conversation history, append-only.
  • routing_decision — the orchestrator's decision: which specialist, why, with what confidence.
  • specialist_context — the enriched payload the orchestrator hands to the specialist (retrieved documents, classified intent, customer ID).
  • specialist_output — the specialist's structured response.
  • final_output — the orchestrator's stitched answer to the user.

The routing_decision and the specialist_context fields are the load-bearing parts of the state. They are where the orchestrator's reasoning becomes a durable artifact that the specialist can read.

The orchestrator node

The orchestrator node receives the latest user message, runs an LLM call with a system prompt that defines the specialists and their domains, and produces a structured output: { "specialist": "billing", "confidence": 0.91, "context_for_specialist": { ... } }. The structured output is enforced with a Pydantic schema or JSON-mode constraint. The orchestrator does not answer the user — it produces a routing instruction.

The specialist nodes

Each specialist is its own LangGraph node (or sub-graph for complex specialists). The specialist receives the state, reads specialist_context, runs its own loop (often a ReAct-style tool-calling loop), and writes its response to specialist_output. LangGraph's edge conditions handle the routing: a conditional edge from the orchestrator inspects routing_decision.specialist and dispatches to the right specialist node.

The stitcher / final node

The stitcher reads specialist_output, optionally adds a confidence wrapper or a "I checked with the billing specialist and they said..." framing, and produces final_output. In the simplest implementation the stitcher is a passthrough; in production it usually adds at least light formatting, citation reformatting, and a fallback handler for the case where the specialist failed.

LangGraph's checkpoint feature is the architectural reason to choose it. Every state transition is persisted (Postgres, Redis, or SQLite). If the specialist crashes mid-tool-call, the graph resumes from the last checkpoint. If you need to debug why the orchestrator routed to support instead of billing, you can replay the graph from the checkpoint just before that decision. For production agent ops, this is the difference between "we shipped it and hope it works" and "we can investigate any incident in under five minutes."

Implementing in CrewAI

CrewAI is the fast-prototype framework of 2026 for role-based multi-agent designs. Its mental model is "a crew of role-defined agents working together." For the orchestrator-worker pattern, the implementation maps as:

  • The manager agent (CrewAI's term) plays the orchestrator role. It receives the task, decomposes it, and delegates to crew members.
  • The crew members are the specialists. Each is defined with a role, a goal, a backstory (CrewAI's prompt-construction pattern), and a tool set.
  • The tasks are the work units. A task has a description, expected output, and (optionally) a specific agent to handle it. The manager agent can dynamically assign tasks based on the input.

CrewAI ships fast — you can have a working orchestrator-worker crew in 90 minutes from a blank file. The trade-off is stateful production. CrewAI's hierarchical mode (with a manager agent) is less battle-tested than LangGraph for long-running agents with durable checkpoints. Teams that prototype in CrewAI often migrate to LangGraph when they hit production scale (we cover this migration cost in the next chapter's lesson on framework selection).

CrewAI is the right choice when: you are building a prototype to validate the pattern, you have fewer than five specialists, your sessions are short (under five minutes), and you do not yet need time-travel debugging.

Implementing in a No-Code Stack: Lindy + Relevance + Vellum

The no-code orchestrator-worker pattern works when your specialists can be expressed as standalone agents or workflows, and your routing logic is simple enough to encode in a prompt. The 2026 reference stack:

  • Lindy hosts the front-door orchestrator agent. Lindy's "agent that can call other agents" pattern is built-in — you define a primary agent with a tool that says "call the billing agent" or "call the support agent." Lindy handles the messaging, the calendar, the Slack/Teams integration, the trigger-based runs.
  • Relevance AI hosts the specialists. Each specialist is a Relevance "Agent" with its own tools, retrieval, and memory. Lindy calls the Relevance agents via webhook or via Relevance's MCP server.
  • Vellum hosts the prompts, the eval sets, and the prompt-versioning layer. Both Lindy and Relevance pull their prompts from Vellum at runtime, which means the prompt engineering team can ship updates without touching the orchestration platform.

The strength of this stack: zero infrastructure to maintain, fast iteration, and the architect can hand the prompt-engineering work to a non-technical PM who works in Vellum directly. The limitation: the seams between platforms are where the failure modes hide. The handoff from Lindy to Relevance is an HTTP call. If the payload is malformed, the specialist gets garbage. If the response times out, the orchestrator does not always handle it gracefully. The platforms are improving here in 2026 (Relevance's "Lindy-compatible agent" template ships with retry logic baked in), but the architect should always assume the handoff layer is the bug surface.

An alternative no-code stack: n8n + LangGraph Studio

For architects who want more control than the Lindy stack but less infrastructure than full LangGraph, the n8n + LangGraph Studio combination has gained traction in 2026:

  • n8n hosts the orchestrator workflow. n8n's AI Agent node (which now uses LangGraph under the hood since the 1.74 release in late 2025) becomes the router.
  • LangGraph Studio hosts the specialist agents as deployed graphs. Each specialist gets a URL endpoint. The n8n orchestrator calls the specialist endpoints.
  • Observability comes through LangSmith (free tier covers up to 5,000 traces per month — enough for most pilots).

This stack costs around 200-400 dollars per month at pilot scale and avoids the per-step pricing of fully-managed platforms like Lindy.

The Handoff Loss Failure Mode

Here is the failure that kills 70% of orchestrator-worker rollouts in their first month. The orchestrator does the routing correctly. It hands off to the right specialist. The specialist confidently produces an answer. The answer is wrong. The root cause is almost never the specialist's reasoning. It is the handoff: the orchestrator's context never reached the specialist.

How it manifests

A customer messages: "I am the CFO of Acme Corp. Following up on the conversation last week with your sales team about the enterprise plan — can I get a refund on last month's overage charges given we are about to upgrade?"

The orchestrator correctly classifies this as a billing question with sales context and routes to the billing specialist. But the orchestrator only sends the literal user message to the billing specialist. The billing specialist sees:

"I am the CFO of Acme Corp. Following up on the conversation last week with your sales team about the enterprise plan — can I get a refund on last month's overage charges given we are about to upgrade?"

The specialist has no idea who Acme Corp is in the customer database, no idea about the upgrade-to-enterprise conversation, no idea about the overage charges. It either refuses to answer (good outcome), hallucinates a refund policy that does not exist (bad outcome), or asks a clarifying question that makes the user feel they have been bounced (mediocre outcome). The user leaves the session worse than they entered it.

Why it happens

Three root causes, in order of frequency:

  1. The orchestrator's prompt did not instruct it to enrich the payload. The orchestrator's job description says "route to the right specialist." It does not say "and also pull the customer context, the recent conversation history, and the relevant account state."
  2. The state schema does not have a place for the enriched payload. The framework passes only the user message because that is the only field designed in.
  3. The specialist's prompt does not tell it to expect the enriched context. Even if the orchestrator sends rich context, the specialist's system prompt does not reference it, so the LLM ignores it or under-weights it.

The fix: the structured handoff payload

The architectural fix is to treat the handoff itself as a first-class artifact with a defined schema. Concretely, the orchestrator does not produce { "specialist": "billing" } — it produces:

{
  "specialist": "billing",
  "confidence": 0.91,
  "user_intent": "refund request for overage charges, with implicit upgrade-to-enterprise context",
  "customer_context": {
    "customer_id": "acme_corp_42",
    "tier": "growth",
    "monthly_spend": 4800,
    "open_sales_conversation": true,
    "recent_overage_charges": [...]
  },
  "conversation_context": "User mentioned 'conversation last week with sales team'. Sales context indicates active upgrade conversation, deal stage 'evaluation'.",
  "specialist_instructions": "User is asking about refund eligibility for overage charges. Pull policy. Cross-reference with sales context — upgrades during overage periods qualify for credit-not-refund per current policy. Confirm before promising anything financial.",
  "success_criteria": "Customer leaves with clear answer on refund eligibility and next step."
}

The orchestrator does the enrichment. The specialist gets a payload it can act on. The user gets the answer they actually wanted.

The handoff payload is not an implementation detail. It is the most important design artifact in the orchestrator-worker pattern. Sketch it on a whiteboard before you write a line of code. If you cannot list the fields in the payload, you have not designed the pattern — you have just named it.

The Other Four Failure Modes

Routing drift

The orchestrator was 91% accurate at routing in week one. By week six, it is 73% accurate. The user population shifted (new product launch, new customer segment) but the orchestrator's prompt did not. Fix: every week, sample 50 routings and ask a calibrated LLM-judge "did this go to the right specialist?" Track the metric. When it drops below your threshold, refresh the orchestrator's prompt with examples from the missed routings.

Specialist sprawl

You started with three specialists. You ended with eleven, because every edge case became a new specialist. Routing accuracy collapses (the orchestrator cannot pick reliably between 11 options) and maintenance cost explodes. Fix: cap specialists at seven, merge low-volume specialists, and use the next lesson's "single smart agent" test on every new specialist request.

Circular routing

Specialist A produces output, the orchestrator inspects it, decides Specialist B should also handle it, B produces output, the orchestrator decides A should refine it, infinite loop. Fix: cap the orchestrator's max round-trips at 3, fail closed (return what you have plus a "could not fully resolve" flag), and log every routing chain longer than 2 hops for review.

The stitcher hallucinates

The specialist returned an accurate answer. The stitcher rephrases it for the user and introduces a fact that was not in the specialist's output. Fix: the stitcher should never paraphrase substantive content. It should pass through the specialist's response with at most light formatting changes and a wrapper. If you need to combine multiple specialist outputs, the stitcher does it through quoting and structured concatenation, not through "let me synthesize what they said."

Instrumenting and Debugging

The orchestrator-worker pattern requires three additional traces compared to a single-agent design:

  1. The routing decision trace. For every input, log the orchestrator's chosen specialist, its confidence, and the alternatives it considered. Without this, you cannot diagnose routing accuracy issues.
  2. The handoff payload trace. For every handoff, log the full payload the orchestrator passed to the specialist. Without this, you cannot diagnose handoff-loss issues — and you will see them.
  3. The specialist→orchestrator return trace. For every return, log the specialist's structured output. Without this, you cannot diagnose stitcher-hallucination issues.

LangSmith, Langfuse, and Arize Phoenix all support multi-agent traces natively as of 2026. Lindy and Relevance AI show traces in their respective consoles but with less depth — for production-grade orchestrator-worker debugging, pair the no-code stack with an external observability platform.

Cost and Latency Profile

The orchestrator-worker pattern adds a 200-600ms latency overhead per turn (the orchestrator's LLM call before the specialist runs) and roughly 15-25% additional token cost (the orchestrator's prompt is small but every turn pays it).

For a typical production workload — 10,000 queries per day, 80% routed to a Haiku 4 / GPT-4o-mini triage specialist, 20% to a Sonnet 4.5 reasoning specialist — the cost breakdown looks like:

  • Orchestrator (Haiku 4, every query): 10,000 × 0.0004 dollars = 4 dollars/day.
  • Triage specialist (Haiku 4, 8,000 queries): 8,000 × 0.0006 dollars = 4.80 dollars/day.
  • Reasoning specialist (Sonnet 4.5, 2,000 queries): 2,000 × 0.04 dollars = 80 dollars/day.
  • Total: ~89 dollars/day or ~2,700 dollars/month.

The same workload run through a single Sonnet 4.5 agent would cost 10,000 × 0.04 = 400 dollars/day or 12,000 dollars/month — 4.4x more expensive. The orchestrator-worker pattern with model tiering is the 2026 cost-optimization play (we cover this in depth in lesson 4 of this chapter).

When to Collapse Back to a Single Agent

Some teams ship the orchestrator-worker pattern, run it for two months, and realize they should have shipped a single smart agent. Three signals that you should collapse:

  1. Your routing accuracy never crossed 80%, and your specialists keep needing the orchestrator's context anyway.
  2. Your specialists have started to overlap (the billing specialist and the support specialist increasingly answer each other's questions).
  3. Your eval set struggles to attribute failures — you cannot tell if it was a routing failure, a handoff failure, or a specialist failure.

Collapsing is not a defeat. It is a design correction. The next lesson covers the cases where collapsing is the right call from day one.

A Twelve-Week Rollout Plan

Week 1-2 — design phase. Sketch the orchestrator prompt, the specialist list, the handoff payload schema, and the success criteria. Write the eval set: 30-50 cases covering the routing decisions you care about.

Week 3-4 — prototype. Build in CrewAI or Lindy if you want speed. Build in LangGraph if you know production matters. Get the happy path working end-to-end.

Week 5-6 — failure-mode hardening. Add explicit handoff-payload enrichment. Add routing-decision logging. Add the stitcher passthrough. Run the eval set. Fix the obvious gaps.

Week 7-8 — pilot rollout. Ship to 5% of traffic behind a feature flag. Watch routing accuracy, handoff-payload completeness, specialist failure rates, and end-to-end latency.

Week 9-10 — eval expansion. Mine the production traces for new routing edge cases. Add them to the eval set. Run the regression check on every prompt change.

Week 11-12 — scale. Roll out to 100%. Set the SLOs (routing accuracy > 85%, handoff completeness > 95%, p95 latency < 3s). Establish the weekly routing-accuracy review.

Key Takeaways

  • The orchestrator-worker pattern is justified when you have at least two of: different tool sets, different memory horizons, different governance regimes, independently versioned prompts, or significant cost/latency gradients between work types.
  • LangGraph is the production default (stateful, durable execution, time-travel debugging). CrewAI is the fast-prototype choice. The Lindy + Relevance + Vellum stack (or n8n + LangGraph Studio) is the no-code path.
  • The handoff payload is the load-bearing artifact. Design it before you write code. It must include user intent, customer context, conversation context, specialist instructions, and success criteria — not just the user's literal message.
  • Handoff loss is the failure mode that kills 70% of orchestrator-worker rollouts. The fix is enrichment in the orchestrator + structured payload in the state schema + explicit context-reading in the specialist's prompt.
  • Cap specialists at seven. Cap routing rounds at three. Make the stitcher a passthrough. Log routing decisions, handoff payloads, and specialist returns separately.
  • The pattern adds 200-600ms latency and 15-25% token overhead per turn. The savings from model tiering across the orchestrator and specialists typically exceed that overhead by 3-5x.
  • Twelve-week rollout: design, prototype, harden, pilot at 5%, expand evals, scale to 100% with SLOs.