What is agent orchestration?
Agent orchestration is the set of decisions about which agent works on what, in which order, and where the results go. The OpenAI Agents SDK docs put it as three questions: "Orchestration refers to the flow of agents in your app. Which agents run, in what order, and how is the next step decided?"
A single agent working alone doesn't need orchestration. You need it once one job is split across several agents, because someone has to split the job, hand out the pieces and put the results back together. Anthropic's How we built our multi-agent research system (June 13, 2025) describes the most common shape, the orchestrator-worker pattern, "where a lead agent coordinates the process while delegating to specialized subagents that operate in parallel."
The orchestrator can be a model, a script or a person. Which one you pick decides how predictable the system is, what it costs, and who can see the plan.
What are the main agent orchestration patterns?
Microsoft Agent Framework ships five built-in patterns: one after another, all at once, hand over, talk it out, or a manager in charge. (Page updated August 25, 2026.) The last column is our reading of who makes the next decision in each:
| Pattern | Microsoft's description | Who decides the next step |
|---|---|---|
| Sequential | "Agents execute one after another in a defined order" | The order you wrote |
| Concurrent | "Agents execute in parallel" | You, up front; the results are merged at the end |
| Handoff | "Agents transfer control to each other based on context" | The agent that is active now |
| Group chat | "Agents collaborate in a shared conversation" | The conversation, under whatever rule picks the next speaker |
| Magentic | "A manager agent dynamically coordinates specialized agents" | The manager agent |
Other frameworks use other names for the same ideas. The OpenAI Agents SDK has two core patterns. In agents as tools, "a manager agent keeps control of the conversation and calls specialist agents." In handoffs, "a triage agent routes the conversation to a specialist, and that specialist becomes the active agent for the rest of the turn." Anthropic's orchestrator-worker pattern is, in our reading, the manager shape. Our agentic workflows guide covers it alongside the other four patterns from Anthropic's Building effective agents, with where a person should check each one. When the specialist is an agent another team or company runs, the open A2A protocol is a standard way to hand it the task; our A2A vs MCP guide explains how that differs from MCP.
Should a model or your code orchestrate agents?
Let a model orchestrate when you can't list the steps in advance, and use code when you can. The OpenAI docs name the two options as "Allowing the LLM to make decisions" and "Orchestrating via code", and say you can mix them. Their trade-off: code "makes tasks more deterministic and predictable, in terms of speed, cost and performance." Their examples of orchestration in code: classify a task with structured output and pick the next agent from the category; chain agents so one's output is the next one's input; loop a task agent against an evaluator until it passes; run independent agents in parallel.
Model-led orchestration costs more, and Anthropic gives numbers. In its research system, "agents typically use about 4× more tokens than chat interactions, and multi-agent systems use about 15× more tokens than chats." In return, a lead agent on Claude Opus 4 with Claude Sonnet 4 subagents "outperformed single-agent Claude Opus 4 by 90.2%" on Anthropic's internal research eval. That result is for research, which splits well. The same post warns that "most coding tasks involve fewer truly parallelizable tasks than research, and LLM agents are not yet great at coordinating and delegating to other agents in real time."
Anthropic says prompt engineering was its primary lever. One of its principles is to teach the lead how to delegate: "Each subagent needs an objective, an output format, guidance on the tools and sources to use, and clear task boundaries." Without them, "agents duplicate work, leave gaps, or fail to find necessary information." Keep those four items in mind. They come back below as the shape of a good card.
How does Claude Code orchestrate agents?
Claude Code has two built-in orchestrators: subagents, where the main session runs everything, and agent teams, where a lead session hands out tasks. Both start from one Claude Code session:
- Subagents run in their own context window and return a result to the agent that called them. The agent teams docs sum up their coordination as "Main agent manages all work". By default a subagent can start subagents of its own, "up to three layers below the main conversation." Our Claude Code subagents guide shows how to write one.
- Agent teams are separate Claude Code sessions. "One session acts as the team lead, coordinating work, assigning tasks, and synthesizing results." Teammates share a task list, and either the lead assigns a task or a teammate picks up "the next unassigned, unblocked task on its own". The docs add that "Task claiming uses file locking to prevent race conditions."
As of November 2026, agent teams are experimental and off until you set CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1. The docs list limits that matter for orchestration: one team per session, no nested teams, and a lead that stays the lead for the whole session. A claude -p run doesn't spawn teammates at all. Anthropic's own advice is to try the lighter option first: "For sequential tasks, same-file edits, or work with many dependencies, a single session or subagents are more effective." For how these compare with running separate agents in separate worktrees, see how to coordinate multiple AI coding agents.
Where does the orchestrator's plan live?
In the orchestrator's context window, for one run, unless you put it somewhere else. That window fills up. Anthropic's lead research agent saves "its plan to Memory to persist the context, since if the context window exceeds 200,000 tokens it will be truncated." The same post recommends that subagents "store their work in external systems, then pass lightweight references back to the coordinator", to avoid a "game of telephone" as results pass through the lead.
Claude Code's built-in options keep that state local. An agent team's task list is a directory on your machine, ~/.claude/tasks/{team-name}/, and "You can't create additional named teams or share a team across sessions." That is fine when one person runs one job in one sitting. It breaks down when:
- some workers are a different tool, such as a Codex or Cursor agent;
- the work outlasts the session, or the plan has to survive a restart;
- a teammate needs to see what is assigned, or change it;
- a person has to sign off before anything counts as done.
In those cases the plan needs to live outside any one orchestrator, in a record that every agent and every person can read. That is what a shared task board is for: the orchestrator still decides, and the board keeps the decision where everyone can see it.
How do you orchestrate agents on a Flux board?
Put each decision on the board: a card is a delegated task, a column is a lane or a state, and a comment is a report back. Flux, task management for AI agent teams, is a hosted kanban board that agents use through the Flux MCP server or the REST API. Who makes the decisions is still up to you. Here is how the three options compare (our summary):
| Who decides | How it shows on the board | Best for |
|---|---|---|
| A lead agent | It creates cards in each worker's lane and comments a summary | Work you can't split until someone reads the code |
| Your code | A script picks cards from a column and starts a worker for each | Repeatable runs, such as a loop over a Ready column |
| A person | They write cards, order them and drag them into lanes | Small teams, and anything that needs judgement or sign-off |
A lead agent in Claude Code can be a custom agent file that is only allowed to plan. Save this as .claude/agents/board-lead.md, add the Flux server under the name flux as on the MCP page, and create the columns Ready - api, Ready - web, Ready - tests, Needs review and Done on the board first, because the lead can't create columns. Start it with claude --agent board-lead. Per the subagent docs, the --agent flag makes the main session take on the agent's "tool restrictions and model". So this lead can read code and create cards, but it has no edit, shell or move tools. Treat it as a starting point and try it on a test board first:
--- name: board-lead description: Lead for a Flux board. Splits a goal card into task cards and puts each one in the lane of the agent that should do it. Never edits code. tools: Read, Grep, Glob, mcp__flux__get_board, mcp__flux__get_card, mcp__flux__list_cards, mcp__flux__create_card, mcp__flux__add_comment --- You decide who works on what. The board records it. 1. Read the goal card with get_card and the board with get_board. 2. Read the code you need with Read, Grep and Glob. Edit nothing. Never copy secrets, keys or .env contents into cards or comments. 3. For each task, create one card with create_card in the lane of the agent that should do it: "Ready - api", "Ready - web" or "Ready - tests". Write every description in four parts: Objective: the one result this card delivers. Output: what to hand back (a pull request, a comment, a file). Tools and sources: the files, commands and docs to use. Boundaries: what is out of scope, and which card owns it. 4. Create prerequisite cards first. If a task needs another card done first, name that card's humanId in its Boundaries line. 5. Comment on the goal card, starting with "[board-lead]": every card you created and its lane. 6. Never move cards. Workers move their own, and a person moves cards to Done.
The four parts of each description are Anthropic's four delegation items, written where a worker in any tool can read them. Each worker is then its own session (Claude Code, Codex or another MCP client) in its own worktree. It takes cards only from its lane, comments when it starts and finishes, and moves the card to Needs review. A person moves it to Done, as in our human-in-the-loop layout.
What Flux does and doesn't do here, checked against the Flux MCP server's code on November 3, 2026:
- Lanes, not locks. Flux has no card locking and no atomic claim, unlike the file locking in Claude Code's agent team task list. No MCP tool assigns a card to anyone either. So one Ready column per agent is what keeps two workers off the same card.
- The tool limit is Claude Code's, not Flux's. The lead can't move cards because its
toolslist leaves outmove_card. Its API key still has the Write scope, and Flux enforces no column order, so the same key in another client could move any card to any column, Done included. - Comments are the report. Changes made over MCP are not yet written to the Flux activity log, so the lead's summary comment and each worker's hand-off comment are the record. Comments made with an API key show under the name of the person who created the key, which is why every agent signs its own.
- Flux runs nothing. It doesn't start, schedule or watch agents. Agents that connect through the API or MCP with an existing member's API key don't take a seat on any plan.
For the orchestration-in-code option, the Ralph loop post shows a loop that starts a fresh agent for the top card in Ready on each pass.
When don't you need agent orchestration?
When one agent can do the job, or when the pieces depend on each other. Anthropic's numbers say a multi-agent run costs several times what one agent does, and its post says most coding tasks don't split as cleanly as research. Claude Code's docs say the same about agent teams: they "work best when teammates can operate independently." If the steps run in a fixed order or touch the same files, one session working down a list of cards is cheaper and easier to review. Start with one agent and a clear card, and add an orchestrator only when the work truly splits.