Primary navigation

Legacy APIs

Orchestration and handoffs

Choose whether specialists take over the conversation or stay behind a manager.

Multi-agent workflows are useful when specialists should own different parts of the job. The first design choice is deciding who owns the final user-facing answer at each branch of the workflow.

Choose the orchestration pattern

PatternUse it whenWhat happens
HandoffsA specialist should take over the conversation for that branch of the workControl moves to the specialist agent
Agents as toolsA manager should stay in control and call specialists as bounded capabilitiesThe manager keeps ownership of the reply

Use handoffs for delegated ownership

Handoffs are the clearest fit when a specialist should own the next response rather than merely helping behind the scenes.

Delegate with handoffs
1
2
3
4
5
6
7
8
9
import { Agent, handoff } from "@openai/agents";

const billingAgent = new Agent({ name: "Billing agent" });
const refundAgent = new Agent({ name: "Refund agent" });

const triageAgent = Agent.create({
  name: "Triage agent",
  handoffs: [billingAgent, handoff(refundAgent)],
});

Keep the routing surface legible:

  • Give each specialist a narrow job.
  • Keep handoffDescription short and concrete.
  • Split only when the next branch truly needs different instructions, tools, or policy.

At the advanced end, handoffs can also carry structured metadata or filtered history. Those exact APIs stay in the SDK docs because the wiring differs by language.

Use agents as tools for manager-style workflows

Use agent.asTool() when the main agent should stay responsible for the final answer and call specialists as helpers.

Call a specialist as a tool
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { Agent } from "@openai/agents";

const summarizer = new Agent({
  name: "Summarizer",
  instructions: "Generate a concise summary of the supplied text.",
});

const mainAgent = new Agent({
  name: "Research assistant",
  tools: [
    summarizer.asTool({
      toolName: "summarize_text",
      toolDescription: "Generate a concise summary of the supplied text.",
    }),
  ],
});

This is usually the better fit when:

  • the manager should synthesize the final answer
  • the specialist is doing a bounded task like summarization or classification
  • you want one stable outer workflow with nested specialist calls instead of ownership transfer

Add specialists only when the contract changes

Start with one agent whenever you can. Add specialists only when they materially improve capability isolation, policy isolation, prompt clarity, or trace legibility.

Splitting too early creates more prompts, more traces, and more approval surfaces without necessarily making the workflow better.

Next steps

Once the ownership pattern is clear, continue with the guide that covers the adjacent runtime or state question.