Handoff
Level: Guided. See the patterns and their levels.
Also called: OpenAI’s “decentralized” pattern, handoff orchestration (Microsoft). OpenAI uses “decentralized” for agents handing work to one another; this catalogue calls that Handoff, and keeps Swarm for peers refining the work together. OpenAI’s experimental Swarm framework, despite its name, was built on handoffs; the Agents SDK has replaced it.
The handoff pattern transfers responsibility from one agent to another when the conversation or task shifts to a domain where a different agent is better suited. There’s no central coordinator deciding who does what — the currently active agent recognizes when the work has moved outside its area and passes the baton to the right peer.
Think of it like a relay race. Each runner carries the baton through their leg of the race, then hands it to the next runner. The difference from prompt chaining is that handoffs aren’t predetermined — the active agent decides when and to whom to hand off based on what’s happening.
The active agent judges when to hand off, but only among the specialists you defined and by the triggers you set. That makes this pattern Guided.
Why It Matters
Section titled “Why It Matters”Many tasks shift as they unfold. A customer starts with a billing question, then mentions a technical issue, then asks about returning the product. A fixed chain of steps can’t handle these shifts — it would need to predict the conversation path in advance.
Handoffs let the system adapt. Each agent carries the full conversation context when it takes over, so the customer never repeats themselves. And because the handoff decision is made by the active agent (not a router at the start), it can respond to signals that only appear partway through.
How It Works
Section titled “How It Works”┌─────────┐ handoff ┌─────────┐ handoff ┌─────────┐│ Agent A │─────────▸│ Agent B │─────────▸│ Agent C ││ (active) │ │ (active) │ │ (active) │└─────────┘ └─────────┘ └─────────┘ Billing Technical Returns- Agent A is active and handling the task or conversation.
- Trigger — Agent A recognizes that the context has shifted to another agent’s area. Triggers can be explicit (“I need help with a return”) or implicit (the agent detects a topic shift).
- Transfer — Agent A hands off to Agent B, passing along the full conversation context and any relevant state.
- Agent B takes over as the active agent. It has the full context and can continue seamlessly.
- Repeat — Agent B may later hand off to Agent C, or back to Agent A.
Handoffs can be one-way (Agent A → Agent B, done) or two-way (agents pass the baton back and forth). The critical design decision is what triggers a handoff — too sensitive and agents ping-pong between each other; too conservative and agents handle tasks they’re not suited for. Put a cap on the number of handoffs in one run.
When to Use It
Section titled “When to Use It”- Conversational flows where the topic shifts unpredictably
- Tasks where different phases require different expertise, but the transition points aren’t predictable
- Systems where agents need full conversation context when they take over
- Multi-turn interactions where a router at the start can’t see the whole picture
- The active agent is best positioned to decide when to hand off (it has the most context)
When Not to Use It
Section titled “When Not to Use It”- The task breakdown is known in advance — use Prompt Chaining or Orchestrator-Workers
- You need a central authority tracking all agents’ work — use Orchestrator-Workers
- Agents need to collaborate simultaneously on the same task — use Group Chat
- Handoff triggers are unreliable, causing agents to ping-pong — simplify to fewer agents or add Routing
Examples
Section titled “Examples”Customer support conversation
Section titled “Customer support conversation”A customer contacts support:
- Triage Agent — Greets the customer, asks how it can help. Customer says “I was charged twice for my order.”
- → Handoff to Billing Agent — Triage detects a billing issue. Passes full context.
- Billing Agent — Looks up the order, confirms the double charge, processes a refund. Customer then asks “Also, the product I received doesn’t work.”
- → Handoff to Technical Agent — Billing detects a product issue outside its scope. Passes context including the refund resolution.
- Technical Agent — Has the full conversation history. Troubleshoots the product issue without asking the customer to repeat anything.
Software development workflow
Section titled “Software development workflow”A coding assistant with specialized agents:
- Planner Agent — Receives a feature request, breaks it into implementation steps, writes the plan. Hands off to the implementer.
- → Handoff to Coder Agent — The coder builds the feature following the plan. Encounters a test failure it can’t resolve.
- → Handoff to Debugger Agent — The debugger diagnoses the failure, fixes the bug, and hands back.
- → Handoff to Coder Agent — The coder continues building the rest of the feature.
Sources
Section titled “Sources”- OpenAI Agents SDK — Agent orchestration (accessed 2026-10-24) — handoffs, where the specialist “becomes the active agent for the rest of the turn”
- OpenAI — A practical guide to building agents (PDF, April 2025) — the decentralized pattern: “agents can ‘handoff’ workflow execution to one another”
- Microsoft — AI Agent Orchestration Patterns, Azure Architecture Center (accessed 2026-10-24) — “Handoff orchestration”
- LangChain — Multi-agent (accessed 2026-10-24) — handoffs, where “agents transfer control to each other via tool calls”
- OpenAI — Swarm (GitHub, accessed 2026-10-24) — the README now says “Swarm is now replaced by the OpenAI Agents SDK”
Related
Section titled “Related”- Workflow Architecture Patterns Overview
- Routing — central dispatch at the start vs. peer-to-peer handoff mid-task
- Orchestrator-Workers — a lead manages delegation vs. agents handing off to each other
- Prompt Chaining — a predetermined sequence vs. handoffs decided by context
- Swarm — peers refining the work together rather than passing the task along one at a time
- Multi-Agent Collaboration — the capability pattern for agent teamwork
- Design Your AI Workflow