AI Agent Orchestration Patterns: Router, Handoff, or Manager

Choose orchestration from who must retain control. Use code routing when the next step is deterministic, a handoff when one specialist should take over the interaction, and a manager when one agent must own the final result while delegating bounded subtasks. Combine patterns only at explicit control boundaries.

By Mario AlexandreAI Agent Engineering

Select the pattern from control ownership

Use the narrowest pattern that expresses the required control flow.
PatternControl ownerBest fitPrimary risk
Code routerApplication logicKnown branches, policy gates, structured classifications, and fixed workflows.Routing rules become stale or omit a valid branch.
LLM router with handoffSpecialist after selectionThe chosen specialist should speak directly and use focused instructions.Ambiguous ownership, unsafe transfer context, or routing loops.
Manager with agents as toolsManager agentOne agent must combine specialist work and own the final answer.Manager becomes a bottleneck or grants specialists excess authority.
Sequential workflowApplication or durable workflow engineEach validated output feeds the next mandatory phase.A malformed output advances the process.
Parallel specialistsAggregator with a merge contractIndependent subtasks can run concurrently and be reconciled.Contradictions, duplicate work, and unbounded fan-out.
Human escalationNamed reviewerRisk or uncertainty exceeds the automated envelope.Approval arrives without enough context or resumes stale work.

Three patterns solve different problems

Route in code when the branch is knowable

A deterministic router is appropriate when account tier, locale, request type, policy outcome, or workflow state already determines the next component. Code makes the branch testable and prevents a model from improvising around a mandatory phase. A model can still produce a structured classification, but application logic should validate the label and own the transition.

Use a handoff when the specialist should take over

The official OpenAI Agents SDK orchestration guide distinguishes handoffs from agents used as tools. In a handoff, a triage agent selects a specialist and the specialist becomes active. This keeps the specialist prompt focused and lets it respond directly. Define what history, user identity, permissions, unresolved questions, and budgets cross the boundary; do not pass the entire trace by reflex.

Use a manager when one agent must synthesize

A manager calls specialists as bounded tools and keeps control of the user-facing result. This fits research, review, or planning work where several outputs must be compared. Give each specialist a narrow contract and no ambient authority. The manager should receive results, not hidden reasoning, and must have a conflict rule when specialists disagree.

For any pattern, durable execution state belongs outside model context. The companion agent state management guide covers checkpoints, retries, and replay.

Make transfers explicit and observable

At each routing edge, record the source, destination, reason code, input artifact references, allowed tools, remaining budget, and expected return shape. Validate the specialist's output before another transition. If the destination can mutate external state, authorization and human approval must remain enforceable after the transfer.

OWASP's Excessive Agency guidance supports minimizing extensions, permissions, and autonomy. Orchestration does not justify copying every tool into every agent. A specialist that only analyzes a document should not inherit email, payment, shell, or production-write tools.

Orchestration failure cases

  • The universal supervisor: one agent plans, delegates, judges, and approves everything. Split deterministic control and independent validation from generation.
  • Routing by polished prose: the router returns an unvalidated destination. Require an allowlisted route identifier and an explicit fallback.
  • Ping-pong handoffs: two specialists transfer the task back and forth. Track visited routes, cap transfers, and escalate unresolved ambiguity.
  • Authority amplification: a low-privilege agent hands off to one with broader tools. Preserve the caller's authority ceiling across every branch.
  • Parallel fan-out without a budget: the manager spawns redundant work. Limit concurrency, calls, time, and return size.
  • Success before merge: specialists finish but nobody validates the combined artifact. Assign one owner and an acceptance predicate.
  • Exact-path evaluation: a valid alternate route is rejected while unsafe side effects go unchecked. Test invariants and forbidden transitions instead.

An implementation sequence that stays bounded

  1. Write the end-state contract. Define the deliverable, allowed side effects, completion evidence, unresolved-state behavior, and final owner.
  2. Map deterministic transitions first. Put policy, schema validation, fixed sequencing, and approval requirements in code or a workflow engine.
  3. Add model judgment narrowly. Use a model router only for categories that cannot be expressed reliably in rules. Constrain it to an allowlist with an unknown route.
  4. Specify every specialist interface. Name inputs, outputs, tools, authority, context window, budget, and stop condition. Keep the interface smaller than the specialist's internal work.
  5. Trace the trajectory. Capture route decisions, handoffs, tool calls, validation results, retries, and terminal state. The agent evaluation checklist separates trajectory quality from final-answer quality.
  6. Test normal and hostile flows. Include ambiguous routes, unavailable specialists, malformed returns, injection in delegated content, denied actions, loops, and budget exhaustion.
  7. Promote gradually. Start with one controlled path, compare against a simpler baseline, and add branches only when a named failure requires them. A workflow primer can help align product owners on the control boundary.

Decision summary

Choose the lightest orchestration pattern that preserves a clear owner for the next decision. Start with direct code, add a router for classification, use handoffs for specialist ownership, and introduce a manager only when centralized planning measurably improves the evaluation set.

Primary and official sources

  1. OpenAI Agents SDK: Agent orchestration — official distinctions among model-led orchestration, code orchestration, handoffs, and agents as tools.
  2. OWASP LLM06: Excessive Agency — primary security guidance for limiting capabilities, permissions, and autonomy.