Back to blog
  • AGENTIC
  • INSIGHTS

What Is AI Agent Orchestration? Architecture, Patterns, and Examples

Viren Baraiya Viren Baraiya CTO
Last updated: · 35 mins read

AI agent orchestration is the coordination of AI agents, the tools they call, and the services and people around them. It is also called agentic orchestration, and it works on two levels. Inside an agent, a model orchestrates tools: it chooses which tool to call, and a runtime enforces the guardrails, policies, and limits around every call. Around the agents, a workflow orchestrates them: a defined process decides when each agent runs, checks what it returns, and connects it to the services, people, and other agents around it.

Most explanations cover one level and leave out the other. This guide covers both, the patterns that connect them, and what has to hold when a model call fails halfway through a run. The code and the failure behavior shown are from Orkes Conductor, because that is what we build. The ideas apply to any runtime, and the patterns are mapped to the names other vendors use.

Diagram of AI agent orchestration on two levels: a workflow fixes the path between steps, and inside the agent step a model chooses between tools. (opens the full-size image in a new tab)
Figure 1. The architecture of AI agent orchestration, on one refund request. A workflow fixes the path between steps. Inside the agent step, a model chooses the path between tools.

Two words carry a lot of weight below. The definition is whatever fixes a path before a run starts: a declarative workflow definition, or workflow code in a code-first engine such as Temporal or Restate. The runtime is the engine that executes the loop and the workflow. It calls the model, runs the tools, applies the checks, and saves the results.

Agent orchestration or agentic orchestration: two names, two meanings

The field has two names. Developer tools and cloud vendors, among them Microsoft, OpenAI, and LangChain, say agent orchestration or AI agent orchestration. Process-automation vendors, among them UiPath and Camunda, say agentic orchestration. The names are used interchangeably, and this guide treats them as one subject.

Under the names there are two meanings, and which one you hear depends on who is speaking.

People who build agents mean what happens inside an agent. A model plans, picks a tool, reads the result, and repeats. Here the model is the orchestrator. Anthropic’s widely cited guide separates workflows, where models and tools follow code paths written in advance, from agents, where the model directs its own process and tool use (Building effective agents).

People who run business processes mean what happens around agents. A process engine coordinates agents, services, and people from the first step to the last, and the agents are participants. Here the process is the orchestrator.

Both are right, and a production system contains both. OpenAI’s Agents SDK documentation draws the same line from the inside: you can orchestrate “via LLM”, where the model plans and decides, or “via code”, where your program sets the order (Agent orchestration).

An agent orchestratesA workflow orchestrates agents
Who decides the next stepA model, while the run is in progressThe definition, written before the run starts
What is coordinatedTool calls inside one agentAgents, services, people, and events
The planEmerges turn by turnKnown in advance
StateThe conversation historyThe saved input and output of every step
Ends whenThe model is done, or a limit tripsThe definition reaches its last step
SuitsOpen-ended work whose path cannot be listedWork that must happen in order, with approvals and a record
Main riskWandering: loops, wrong tools, costRigidity: a case nobody planned a path for

Multi-agent orchestration is the part of the subject that deals with several agents. It is not a third meaning: either a model decides which agent goes next, or a definition does. The patterns below are sorted by that question.

What is the orchestration layer in agentic AI?

The orchestration layer of an agentic AI system is the software between the models and the systems they act on. A model proposes an action. The orchestration layer decides whether, when, and how it runs. It manages five things:

It managesWhich means
Control flowWhat runs next: the next tool, the next agent, the next step
StateWhat has happened so far, saved so that a run can continue after a failure
Tools and agentsHow each one is called: schemas, credentials, timeouts, and retries
PolicyWhat is allowed: guardrails, limits, approvals, and permissions
FailureWhat happens when a step breaks: retry, compensate, or escalate

This guide calls the orchestration layer the runtime. Two narrower names for its parts, the agent harness and the agent runtime, are sorted out under Frameworks, harnesses, and runtimes. The next two sections take the two levels in turn.

Inside an agent: a model orchestrates tools

An agent is a loop around a model. On each pass, called a turn, the model sees the conversation so far and either answers or asks for a tool. The loop is short to write and hard to run well, because the part that decides (the model) cannot be trusted to enforce anything. Enforcement belongs to the runtime around it.

One turn of the loop

Diagram of one turn of an AI agent loop: the model makes one decision, the runtime does the rest, and the turn can be checked in four places, A to D. (opens the full-size image in a new tab)
Figure 2. One turn of an agent loop. The model makes one decision per turn. The runtime does everything else, and can check the turn in four places (A to D).
  1. Assemble the context. The runtime builds the model’s input: the instructions, the conversation so far, and a schema for every tool the agent may use. If the history has outgrown its budget, older turns are condensed first. Deciding what goes into this input is the work now called context engineering.
  2. Call the model. It returns text, or one or more tool calls. A tool call is a tool name and arguments as JSON.
  3. No tool call: finish. The text is the answer. It passes the output check and goes back to the caller.
  4. A tool call: run it. The call is checked, held for a person if the tool requires approval, and executed as a task with its own timeout and retry policy. Calls that do not depend on each other can run at the same time.
  5. Append the result. The tool’s output, or its error, joins the history, and the next turn begins.

The loop ends in one of three ways: the model answers, a limit trips, or a check stops the run.

What the model decides, and what the runtime decides

DecisionDecided by
Which tool to call next, and with what argumentsThe model
Whether the work is finishedThe model
Which tools exist, and their schemasThe definition
Whether a particular call may runThe runtime, through guardrails
Whether a person must approve it firstThe definition
How many turns, tokens, and tool calls the run may spendThe definition
What happens when a tool fails or times outThe runtime, through a retry policy
Which credentials a tool runs withThe runtime. The model never sees them

An instruction in a prompt is a request. A check in the runtime holds whether or not the model honors the request. Every rule that matters should exist as a check.

Tools are tasks

A tool call reads like a function call. In production it is a remote call that can be slow, fail, or half-finish, so each one needs what any distributed task needs:

  • A schema in and a schema out. Malformed arguments are rejected before the tool runs. The schema is also how the model learns what the tool does.
  • A timeout and a retry policy of its own. A lookup can retry three times. A payment should not retry blindly.
  • An idempotency key for anything that writes. If a worker runs a tool and dies before reporting, the runtime runs the tool again. With a key, the second run does nothing.
  • Errors as results. A failed lookup can go back to the model as an observation, and the model may try another route. A failed write should stop and surface.
  • Credentials injected at execution. They are attached to the tool by name and never appear in a prompt, an input, or the history.

The Model Context Protocol (MCP) standardizes the first point. An MCP server publishes tools with schemas, and any MCP client can list and call them. MCP defines how a model reaches a tool. Retries, approval, and the record of the call are left to whatever runs the loop.

Guardrails: four places to check

A guardrail is a check that runs as part of the loop, at a point where something can go wrong. There are four such points, marked A to D in Figure 2.

PositionWhat it catchesTypical outcome
AAgent inputPrompt injection, out-of-scope requests, sensitive data coming inBlock, or return a safe answer
BAgent outputLeaked personal data, answers outside policyAsk again with feedback, or send to a person
CTool inputDangerous arguments, before a side effect happensReject before the tool runs
DTool outputBad, oversized, or hostile data returned by a toolStop, repair, or escalate

Position C is the one that protects writes: it is the last point before a refund is issued, an email is sent, or a record is changed. Position D matters for a less obvious reason. Text that comes back from a tool, such as a web page, a document, or a ticket, can contain instructions aimed at the model. Treat tool results as evidence to weigh, never as instructions to follow.

There are three kinds of check, from cheapest to most capable:

  • Deterministic: a regex, a schema, or an allow-list. Fast, free, and predictable. Use it for formats, card numbers, and known dangerous strings.
  • A model as judge: a second model scores the content against a written policy. Use it for meaning, such as tone or whether an answer is grounded in its sources. It costs tokens and can be wrong, so it should never be the only control on a write.
  • Your own code: a function or service with access to application state, for rules such as “is this refund within this customer’s limit?”

When a check fails, a runtime can do one of four things: ask the model again, with the failure as feedback and a cap on attempts; stop the run; repair the output; or pause for a person to review.

Here is position C in code, using the Conductor agent SDK for Python. The check rejects anything shaped like a card number in the tool’s arguments, and approval_required adds a human decision before the tool runs.

from conductor.ai.agents import OnFail, Position, RegexGuardrail, tool
no_card_data = RegexGuardrail(
patterns=[r"\b(?:\d[ -]?){15}\d\b"],
name="no_card_data_in_email",
position=Position.INPUT,
on_fail=OnFail.RAISE,
message="Refusing to send payment-card data by email.",
)
@tool(guardrails=[no_card_data], approval_required=True)
def send_email(to: str, subject: str, body: str) -> dict:
# Call your mail integration here.
return {"status": "sent", "to": to}

Policies and limits

Guardrails inspect content. Limits bound behavior, whatever the content is. When a limit trips, the runtime refuses the step or ends the run.

LimitWhat it bounds
Turn limitRunaway loops. If you set only one limit, set this one
Token budgetThe cost of each model call, and how large the context may grow
Calls per toolAn agent that hammers one API
Time limitA run that hangs
Tool allow-listReach: which systems the agent can touch at all
Allowed transitionsWhich agent may hand work to which

One rule keeps these honest: anything that widens what an agent can reach is part of its definition, and a caller cannot change it at run time. A caller may pick a cheaper model for one run. A caller may not add a tool.

Security: three questions

Most of an agent’s security comes down to three questions.

  • Whose authority does each tool call run under? The agent’s own identity, with narrow permissions of its own, or the user it is acting for. Decide this for each tool, and never let an agent inherit a developer’s or an operator’s access.
  • What untrusted text can reach the model? Web pages, documents, emails, and tickets can all carry instructions. A check at position D helps, and no check is reliable enough to be the only defense.
  • Can one agent read private data, read untrusted content, and send data out? An agent with all three can be steered into leaking what it reads. Simon Willison named this combination the lethal trifecta. Take one of the three away from any single agent. Splitting the work between two agents with different tools is one way to do it.

Human-in-the-loop: approval is a durable pause

When an agent calls a tool that requires approval, the run stops at that step. Its state is in storage, and no process sits waiting. The answer may come in seconds or in days, and a restart in between changes nothing. Three things need a decision when you design the pause:

  • What the approver sees: the tool, its arguments, and the agent’s reason, in a form a person can judge quickly.
  • What happens if nobody answers: a timeout, and who the request escalates to.
  • What a rejection does: goes back to the model as feedback, or ends the run.

Around the agents: a workflow orchestrates agents

One agent in a loop is rarely the whole job. A refund agent needs the customer record before it starts. Its proposal needs a policy check. A large refund needs a person. The refund itself is a call to a payment service, and other systems need to hear that it happened. That sequence is a process, and a process needs an owner. In agent orchestration the owner is a workflow.

An agent is a step, behind a boundary

Diagram of an AI agent as one step of a workflow: the workflow checks what goes in and what comes out, and owns the approval and the write. (opens the full-size image in a new tab)
Figure 3. An agent as one step of a workflow. The workflow checks what goes in and what comes out, and it owns the approval and the write.

The workflow treats an agent as a step whose output is not trusted until it has been checked:

  1. Validate the request before the agent sees it: its shape, the caller’s permissions, the IDs it refers to.
  2. Run the agent. Give it tools that read, and let it propose.
  3. Validate the result. Ask for output that matches a schema where the model supports it, then parse it and check it against the policy anyway. A schema guarantees the shape of an answer, not its truth. A model’s answer is data.
  4. Approve. A person decides when the write is consequential.
  5. Write once, with an idempotency key.
  6. Compensate. If a later step fails after the write, run the step that undoes it.

The rule that falls out is short: nothing irreversible happens on the model’s word alone.

What sits behind the boundary can change without changing the workflow. It can be model and tool tasks placed directly in the workflow, an agent written with a framework and deployed, or a remote agent that another team owns.

An approval can live on either level. Put it inside the loop, on the tool, when the agent needs the result to keep working. Put it in the workflow, after the agent finishes, when the write is the outcome of the agent’s work.

Agent orchestration patterns: who decides which agent runs next

Nine agent orchestration patterns: sequential, parallel, router, handoff, supervisor, swarm, evaluator loop, group chat, and plan and execute. (opens the full-size image in a new tab)
Figure 4. Nine agent orchestration patterns, each labeled with who decides which agent runs next.

An agent orchestration pattern is a recurring way to arrange several agents. Every one of them answers the same question: who decides which agent runs next?

  • The definition decides in sequential and parallel. These are predictable and cheap, because no model call is spent on routing.
  • A model decides in router, handoff, supervisor, and swarm. These adapt to the input, and pay for a decision each time.
  • Both in the evaluator loop, group chat, and plan and execute. The definition fixes the shape, and a model makes one decision inside it: whether the work passes, who speaks next, or what the plan is.

Some practical notes on choosing:

  • Router or handoff. A router classifies once and dispatches. A handoff transfers the conversation, and the specialist keeps it. Use a router when there is nothing to converse about.
  • A supervisor keeps control, and every result returns through it. LangChain’s comparison of its own patterns shows both sides of that trade: one more model call on a simple request (four against three), and fewer tokens on a task that spans domains (about 9,000 against 14,000 or more for a chain of handoffs), because each sub-agent works in its own context.
  • Swarm and group chat need an exit. Without a rule for who may hand to whom and when to stop, two agents can pass a task back and forth until a limit ends the run.
  • Parallel means a real fork and a join. Each branch needs its own failure handling, and the join needs a rule for what happens when one branch fails.
  • Start lower than you think. Microsoft’s guidance on agent orchestration patterns lists three levels (a direct model call, a single agent with tools, and several agents) and recommends the lowest one that reliably meets the requirement.

What each pattern costs, and how it fails

PatternModel calls spent on routingIt ends whenHow it goes wrongIn Conductor
SequentialNoneThe last agent finishesAn early mistake is carried to the endsequential
ParallelNoneEvery branch has joinedOne slow or failed branch holds the joinparallel
RouterOneThe chosen agent finishesA wrong classification gets no second lookrouter
HandoffOne for each transferThe agent holding the conversation answersA transfer to the wrong specialist, or back and forthhandoff
SupervisorOne for each delegation, and one to combineThe supervisor answersEvery result returns through one context, which fillsAn agent given other agents as tools, with agent_tool
SwarmOne for each transferAn agent answers instead of transferringAgents pass the task around until a limit ends the runswarm
Evaluator loopOne for each reviewThe reviewer passes the work, or a round limit is reachedA reviewer that never passes, or passes everythingA loop in the workflow, or a guardrail judged by a model
Group chatOne for each turn, when a model picks the speakerA termination rule firesA thread that grows until every turn is expensiveround_robin for a fixed rotation, manual when your code picks the speaker
Plan and executeOne to plan, and one for each replanThe plan is completeA plan that is wrong from its first stepplan_execute

Three of the nine have no strategy of their own in Conductor, and the last column says how each is built.

The same patterns under other names

Every vendor names these patterns differently. This table gives the closest name in each source. A dash means the source has no direct equivalent. Where a source describes a pattern without naming it, as OpenAI’s page does for its code-driven techniques, the cell is a short description.

PatternAnthropicMicrosoftGoogle CloudOpenAI Agents SDKLangChain
SequentialPrompt chainingSequentialSequentialChainingCustom workflow
ParallelParallelizationConcurrentParallelParallel executionCustom workflow
RouterRoutingHandoff, as routingCoordinatorClassify, then branch in codeRouter
Handoff—Handoff—HandoffsHandoffs
SupervisorOrchestrator-workers—Hierarchical task decompositionAgents as toolsSubagents
Swarm——Swarm——
Evaluator loopEvaluator-optimizerMaker-checker loopReview and critiqueEvaluator loop—
Group chat—Group chat———
Plan and execute—Magentic———

Two notes on reading it. What Google Cloud calls the ReAct pattern is the loop inside one agent: reason, act, observe, repeat. And explainers that describe “centralized”, “decentralized”, and “hierarchical” orchestration are describing topology: centralized is a supervisor, decentralized is a swarm or a chain of handoffs, and hierarchical is supervisors that supervise supervisors.

Memory and sessions: what an agent keeps

Each agent has its own context window, so every handoff is a decision about what to pass on. Pass results, not histories: a typed result or a short summary is cheaper than a transcript, and it keeps one agent’s working notes from steering the next. What the process needs, such as IDs, decisions, and amounts, belongs in the workflow.

What an agent keeps for itself comes in three kinds, and each lives in a different place.

KindWhat it holdsWhere it livesHow long
The runThe messages and tool results of the task in progressSaved with the steps of the runUntil the run ends
The sessionThe conversation with one user, or on one case, across runsA history keyed by a session IDAs long as the conversation
Long-term memoryWhat is worth keeping: preferences, past decisions, documentsA store that the agent searches, usually by meaningUntil it is deleted

Two questions decide whether memory works in production.

  • What goes into each model call? A history that grows without limit is paid for again on every turn. Trim it, summarize it, or search it.
  • What happens when two messages reach one session at the same moment? Two runs that read the same history will each write over the other. Restate’s agent runtime guide counts single-writer state for each key among a runtime’s jobs. Whatever runs your agents, decide who goes first. The Conductor SDK loads a session’s history from its most recent completed run, so send the next message for a session after the last run has finished.

In the Conductor SDK the three are ConversationMemory, which bounds the thread a model sees, a session_id on a run, which ties runs into one conversation, and SemanticMemory, which searches a store. Two posts go deeper: conversational memory and semantic memory.

MCP and A2A: the protocols around a run

Diagram of where the MCP and A2A protocols sit around an orchestrated agent run: calls into the run, and calls out to tools and other agents. (opens the full-size image in a new tab)
Figure 5. Where the two agent protocols sit around an orchestrated run. A run can be called through them, and can call through them.

Two protocols define the hops between these parts. MCP connects a model to tools. A2A (Agent2Agent) connects an agent to another agent it does not own: the caller reads the remote agent’s card and sends it a message, and when the work takes time, it follows the resulting task through states such as working, input-required, completed, and failed.

Neither protocol is an orchestrator. Each defines one hop. Orchestration decides which hops happen, in what order, and what to do when one fails. A run can also sit on both sides of both protocols: it can be exposed to callers as an MCP tool or an A2A agent, and it can call MCP tools and A2A agents as steps.

How much should the model decide?

Diagram of how much of the path the model decides, in five stops. AI agent orchestration covers the last three. (opens the full-size image in a new tab)
Figure 6. How much of the path the model decides, in five stops. AI agent orchestration covers the last three.

Every stop to the right buys flexibility and costs predictability, latency, tokens, and the ability to test the path in advance.

If the step…Give the decision to
must happen, in a fixed orderThe definition
moves money, sends a message, or changes a recordThe definition, with an approval
depends on reading unstructured inputA model
has a path nobody can list in advanceA model, in a loop with limits
has to be explained to an auditorThe definition, with the model’s reasoning recorded as data

The third stop, a workflow with one or two agent steps, is a sound default for work that changes anything. Keep the open-ended agent for exploration, where a wrong turn is cheap: research, drafting, and analysis with tools that only read. Anthropic and Microsoft give the same advice from different directions, which is to start with the simplest design and add autonomy only where it pays for itself.

AI agent orchestration use cases

The same split shows up in every use: a model handles the part that needs judgment, and a definition guarantees the rest.

UseThe model decidesThe definition guarantees
Customer support and refundsWhether a request qualifies, and what to tell the customerAn approval above a limit, one payment, a record of why
Software delivery with coding agentsHow to plan, write, and fix a changeTests pass, a person reviews, the merge happens once
Claims and document processingWhat a document says, and what is missingRequired checks run, and an adjuster approves exceptions
Incident responseWhich diagnostics to run, and the likely causeNo remediation without approval, and every action logged
Research and reportingWhat to search, read, and concludeSources are recorded, and time and cost are capped

The first row is built end to end in the refund example below. The second is how a team at LinkedIn runs coding agents on Conductor, as its engineers described at Orkes Shift ‘26.

AI agent orchestration frameworks, tools, and platforms

The products sold under this name fall into four groups. They do different jobs, and most production systems combine two of them: a framework to write the agents, and an engine to run them.

GroupWhat it gives youExamples
Agent frameworksA way to write an agent: its prompts, tools, and loopLangGraph, CrewAI, OpenAI Agents SDK, Google ADK, Microsoft Agent Framework, Pydantic AI
Durable workflow enginesA runtime that saves every step and survives failures and long waitsConductor, Temporal, Restate, Camunda, Inngest
Hosted agent platformsA cloud service that deploys and scales agentsAmazon Bedrock AgentCore, Microsoft Foundry Agent Service, Vertex AI Agent Engine
Process automation suitesAgents, people, and systems coordinated inside modeled business processesUiPath Maestro, IBM watsonx Orchestrate, Salesforce Agentforce, Workato

The groups overlap. LangGraph describes itself as both an orchestration framework and a runtime, and Camunda as an agentic orchestration platform.

Frameworks, harnesses, and runtimes

A second way to cut the same field is by layer. Restate describes three. A framework gives you the building blocks to define an agent. A harness runs the agent’s loop: prompts, tool wiring, context, and limits. A runtime executes the agent in production: lifecycle, recovery, durable state, concurrency, and control.

LangChain uses the same three words in a different order. Its runtime, LangGraph, sits under its framework, and its harness is a ready-made agent built on top of both. The words are not settled, and products combine the layers.

In the terms of this guide, a harness is the inner level, and a runtime is what makes both levels durable. Orchestration is the part that decides what runs next, on either level. A runtime with no orchestration recovers an agent and cannot govern it. Orchestration with no runtime governs an agent that does not survive a crash.

For a side-by-side comparison with sources, see Conductor next to Temporal.

Durable execution for AI agents: what failure looks like

A demo skips this part. In production it is most of the work.

Both levels need durable execution underneath them: the result of every completed step is saved before the next step starts, so recovering from a failure means continuing from the last saved step. An agent run this way is called a durable agent, and it is what makes long-running, stateful agents practical: a run that lasts for days keeps its state in storage, not in a process. The table below is what that buys you, and what it leaves to you. The behavior in the middle column is Conductor’s, as documented in its failure semantics. Other engines differ in the details, so check yours.

What failsWhat the runtime doesWhat you still design
A model call errors or times outRetries that call, with backoff. Earlier steps are not run againA retry policy and a response timeout for each model step
A step in an agent loop uses up its retriesFails the loop. Retrying the loop starts its turns againA turn limit, and tools that are safe to repeat
The model returns malformed outputNothing: the call succeededA validation step after the model, before anything acts on its output
A tool times out, and the call may have workedRetries it. The first request may still be in flightTools that are safe to call twice
A worker dies after a side effect, before reportingRuns the task againAn idempotency key, so the second run does nothing
Nobody answers an approvalWaits, using no computeA timeout and an escalation path
The same approval arrives twiceRejects the second: the step is already completeNothing
A decision goes stale while the run waitsNothing: the wait ended normallyA check, at the write, that what the decision rested on has not changed
One parallel branch failsRetries that branch while the join waitsWhether the other branches should be canceled
The definition changes during a runRuns in progress keep the version they started withHow runs already in progress move to the new version
The run lasts for weeksTreats it as normalPayload size, history growth, and an overall timeout

Five of these deserve more than a row.

Delivery is at least once. No runtime can promise that a tool runs exactly once, because a worker can finish the work and die before saying so. What a runtime can promise is that the tool runs at least once and that its result is recorded once. The gap is closed by the tool: derive an idempotency key from stable identifiers, such as the run ID and the step, and let the receiving system discard the repeat. Never derive the key from model output, which can differ between attempts.

Retries cost tokens. When a model call succeeds and its result is lost on the way back, the call runs again and its tokens are spent twice. That is the price of at-least-once delivery, and it is small. The alternative is larger: without saved steps, a crash at step nine of ten repeats all nine.

Compensation is harder with agents. In a fixed workflow, every write is known in advance, and each can have a declared undo. An agent that writes inside its loop chooses its writes at run time. This is the strongest reason for the boundary in Figure 3: keep writes in the workflow, where each has a known compensation. If a tool must write inside the loop, pair it with a tool that reverses it, and record what ran.

A durable wait keeps the decision, not the facts. A run that waits two days for an approval resumes with everything it knew two days ago. Kiran Prakash describes the problem in Long-horizon agents and durable execution: an agent decides at one time and acts at another, and the facts behind the decision go stale in between. The fix is an old one, an optimistic lock. Carry the version of what was read to the write, and let the write refuse if the version has moved.

Durability has a price. Saving every step adds a write, and so a little latency, to every step. For a short exchange that only reads, and that a user can simply ask again, that is overhead with no return. It pays for itself when a run is long, expensive, waits on people, or writes.

An AI agent orchestration example: one refund, end to end

The request is “Refund order 1042. It arrived damaged.” The design follows Figure 1: the agent investigates and proposes, and the workflow checks, approves, and pays.

The agent has two tools that read, a typed answer, and no way to issue a refund. It is written with the Conductor agent SDK for Python; orders and policies stand for your own services.

from pydantic import BaseModel
from conductor.ai.agents import (
Agent, AgentRuntime, OnFail, Position, RegexGuardrail, tool,
)
class RefundProposal(BaseModel):
refund: bool
amount: float
reason: str
@tool(max_calls=3)
def lookup_order(order_id: str) -> dict:
"""Fetch an order, its items, and its delivery status."""
return orders.get(order_id)
@tool
def check_policy(order_id: str, reason: str) -> dict:
"""Return the refund policy that applies to this order and reason."""
return policies.evaluate(order_id, reason)

The agent adds an output check, so a card number that turns up in an order record cannot travel on in its answer, and a turn limit. serve registers the agent and runs the workers for its tools.

no_card_numbers = RegexGuardrail(
patterns=[r"\b(?:\d[ -]?){15}\d\b"],
name="no_card_numbers",
position=Position.OUTPUT,
on_fail=OnFail.RETRY,
)
refund_agent = Agent(
name="refund_agent",
model="openai/gpt-4o-mini",
instructions="Decide whether this order is due a refund, and how much. You cannot issue one.",
tools=[lookup_order, check_policy],
output_type=RefundProposal,
guardrails=[no_card_numbers],
max_turns=8,
)
with AgentRuntime() as runtime:
runtime.serve(refund_agent)

The workflow calls that agent as one of its steps.

StepTypeWhat it guarantees
crm_lookupHTTPThe order total comes from the system of record, never from the model
refund_agentAgentThe model investigates and proposes. It has no tool that writes
check_proposalInlineThe answer is read as data. Anything unreadable, or more than the order total, fails the run
routeSwitchNo refund ends the run. More than $50 goes to a person
approve_refundHumanAnything other than an explicit approval ends the run, and so does three days with no answer
issue_refundWorkerOne write, with a key that is the same on every retry, and none at all if the order has changed
refund.issuedEventThe systems that listen hear about it

Three of those steps are worth reading as code. The agent call pins a version, so a redeploy cannot change the agent underneath the runs that depend on it.

{
"name": "refund_agent",
"taskReferenceName": "agent",
"type": "AGENT",
"inputParameters": {
"agentType": "conductor",
"name": "refund_agent",
"version": 3,
"prompt": "Order ${workflow.input.orderId}. The customer says: ${workflow.input.message}"
}
}

The check treats the agent’s answer as data. It is the expression of an INLINE task with two inputs: answer, set to ${agent.output.output.result}, and orderTotal, set to the value that crm_lookup returned. If anything is off it throws, and the run fails closed.

(function () {
var p = typeof $.answer === "string" ? JSON.parse($.answer) : $.answer;
if (!p || typeof p.refund !== "boolean" || typeof p.amount !== "number") {
throw new Error("unreadable proposal");
}
if (p.refund && (p.amount <= 0 || p.amount > $.orderTotal)) {
throw new Error("amount is outside the order total");
}
var route = !p.refund ? "none" : p.amount > 50 ? "review" : "auto";
return { amount: p.amount, reason: p.reason, route: route };
})();

A SWITCH on route ends the run for none, sends review to the HUMAN task, and lets auto through. A HUMAN task waits for as long as it takes unless its task definition sets timeoutSeconds. This one does, so a request that nobody answers in three days ends the run. After the approval, a second SWITCH continues only on an explicit yes.

{
"name": "approved",
"taskReferenceName": "approved",
"type": "SWITCH",
"evaluatorType": "value-param",
"expression": "approved",
"inputParameters": { "approved": "${approval.output.approved}" },
"decisionCases": { "true": [] },
"defaultCase": [
{
"name": "rejected",
"taskReferenceName": "rejected",
"type": "TERMINATE",
"inputParameters": {
"terminationStatus": "COMPLETED",
"terminationReason": "Refund rejected by the approver"
}
}
]
}

Only then does the write run. Its key is built from the run ID, so it is the same on every retry, and the payment service can discard a repeat. It also carries the version of the order that crm_lookup read. The approval may have taken two days, and the order may have been cancelled or refunded another way in that time. So the worker first marks the order as refunded with a conditional update in the order system, which succeeds only if the order still has that version. If it does not, the step fails and no money moves.

{
"name": "issue_refund",
"taskReferenceName": "refund",
"type": "SIMPLE",
"inputParameters": {
"orderId": "${workflow.input.orderId}",
"amount": "${proposal.output.result.amount}",
"orderVersion": "${crm_lookup.output.response.body.version}",
"idempotencyKey": "${workflow.workflowId}-refund"
}
}

A failureWorkflow on the definition starts whenever the run fails. It reverses the refund only if issue_refund completed, so a run that failed at check_proposal, before any money moved, is left alone.

The record of a refund run handled by an AI agent, with the agent step opened to show its turns. (opens the full-size image in a new tab)
Figure 7. The record of that run. The agent step is opened to show its turns, and the two switches are left out.

Three things in the record are worth reading closely.

  1. The second model call failed, and only that call ran again. The first model call and the order lookup were already saved, so neither was repeated and no tokens were spent twice.
  2. The approval took two days, and the server restarted in between. The run was a row in storage the whole time. When the support lead approved, it continued from the same step.
  3. The refund ran once. A retry of issue_refund would carry the same key, and the payment service would return the first result.

The model made the judgment call: this order qualifies, for this amount, for this reason. The definition made every guarantee: the order of steps, the limits on the agent, the check on its answer, the approval, and the single write.

Testing an agent step

A model’s output varies from run to run, so tests assert on behavior and bounds instead of exact text. This one runs the refund agent above and checks the path it took. The assertions are from the testing module of the Conductor SDK.

import json
from conductor.ai.agents import AgentRuntime
from conductor.ai.agents.testing import expect, record
def test_refund_agent_reads_then_proposes():
with AgentRuntime() as runtime:
result = runtime.run(refund_agent, "Refund order 1042. It arrived damaged.")
(expect(result)
.completed()
.used_tool("lookup_order", args={"order_id": "1042"})
.used_tool("check_policy"))
assert len(result.tool_calls) <= 4 # it did not wander
answer = result.output["result"] # the answer arrives as data
if isinstance(answer, str):
answer = json.loads(answer)
proposal = RefundProposal.model_validate(answer)
assert 0 < proposal.amount <= 84.00 # never more than the order total
record(result, "recordings/refund-1042.json")

The test parses the answer itself, as the workflow does: a run returns the agent’s output as data, not as a RefundProposal.

  • Test the path as well as the answer: which tools were called, with what arguments, in how many turns, and how the run ended.
  • Test every check twice, with an input that should pass and one that should fail, and confirm that a blocked call never reaches the tool.
  • Test the failure paths: stop a worker in the middle of a run, let an approval expire, return an error from a tool, and read the record afterward.
  • Keep recordings. record saves a run’s tool calls and outcome to a file. Before you promote a new prompt or model, run the same requests again and compare the tools called, the turns taken, and how each run ended.
  • Script the paths a model will not take on demand. mock_run builds a result from a list of events that you write, with no model and no server, and runs the real tool functions.

The orchestration layer, the harness, the runtime, and the durable agent are defined in their own sections above. These are the neighboring terms.

TermWhat it meansHow it relates
Multi-agent orchestrationCoordinating several agentsOne part of it: the patterns in Figure 4
Agentic AIAI systems that pursue goals by planning and actingThe wider category. Orchestration is the part that coordinates it
Agentic workflowA workflow in which one or more steps are agentsThe outer level, seen from the side of the process
Agentic process orchestrationA process engine coordinating agents, people, and systemsThe name process-automation vendors give the outer level
Workflow orchestrationCoordinating the steps of a process across services and peopleThe base that the outer level builds on
LLM orchestrationChaining prompts, retrieval, and model callsThe second stop in Figure 6. No agent loop is required
Durable executionSaving every step so a run survives failureWhat both levels run on in production

How Orkes Conductor implements both levels

Orkes Conductor is an AI agent orchestration platform built on Conductor OSS. It treats the two levels as one mechanism: an agent is compiled into a workflow, so the loop in Figure 2 and the process in Figure 1 run on the same engine and leave the same kind of record. Our architecture post describes the same split between model and runtime as a reasoning plane and an execution plane.

Inside an agent. You write an agent with the Conductor SDK in Python, Java, TypeScript, or C#, or bring one written with LangGraph, LangChain, the OpenAI Agents SDK, Google ADK, or the Vercel AI SDK. The SDK compiles an agent into a workflow definition: a loop around a model call, in which each tool call, output guardrail, and approval is a task. For an agent from another framework, how much becomes separate steps depends on what the SDK can extract from it. Where it finds the model and the tools, each call is a step. Where it cannot, the agent runs as a single task.

  • Each step is saved as it completes. A failed model call retries by itself, and completed steps are not run again.
  • Guardrails on agent output and on tool input and output are part of the run, written as a regex, a model as judge, your own worker, or an external policy service. A failed check can retry, raise, fix, or pause for a person. A check on the incoming request runs before the run starts: in the SDK when you call the agent from code, or as a step in the workflow that calls it.
  • Limits are part of the definition: max_turns (25 unless you set it), a token cap, calls per tool, and allowed transitions. A caller can override the model for one run and cannot add a tool.
  • Approval is one flag on a tool, approval_required, and the run resumes on the decision whenever it comes.

Around the agents. A workflow calls a deployed agent with the AGENT task, next to HTTP calls, workers, human tasks, waits, and events. The same task calls a remote agent over A2A. Agent teams are declared with one field, the strategy:

StrategyWho decidesWhat runsBuild it
handoffThe modelOne sub-agent, which takes over the conversation
routerThe modelOne sub-agent, with no conversationIssue triage bot
sequentialThe definitionAll of them, in orderSupport ticket pipeline
parallelThe definitionAll of them, at onceThree reviewers, one PR
swarmThe sub-agentsEach in turn, until one finishesSupport swarm
round_robinThe definitionThe next in rotationCode review debate
randomThe definitionOne, at randomBrainstorming session
plan_executeThe model, then the definitionA planned sequence, replanned as results come in
manualYour codeWhatever your code selectsEditorial workflow

Each sub-agent runs as its own execution with its own tools and guardrails, so one can retry without repeating the routing decision. At Orkes Shift ‘26, two LinkedIn engineers described a team of coding agents run on Conductor: a product agent, an architect, developers, QA, and a code reviewer, with a person approving the plan. In one month it shipped 40 features. Workflows and agents can be exposed over MCP and A2A, and can call both. Orkes Conductor Enterprise adds human task forms with assignment and escalation, and access control for agents. The multi-agent guide has a runnable example of each strategy.

How Conductor differs from LangGraph, Temporal, and Restate

All four run agents durably. This table describes each one in the terms of its own documentation. A linked cell goes to the page it comes from.

LangGraphTemporalRestateConductor
Calls itselfAn agent orchestration framework and runtimeA durable execution platformA durable runtime for agents and backendsA durable workflow and agent runtime
The agent loop isNodes of a graph, in your codeWorkflow code, replayed on Workers that you deployHandler code on your compute, with an agent SDK or your own loopA workflow that the SDK compiles from your agent, or tasks in a definition
Model and tool callsCalls inside nodesActivities on Workers. Deterministic tools can run in the WorkflowJournaled steps in the handlerBuilt-in tasks on the server, or your workers
GuardrailsMiddleware, built in for PII and human review, or your ownThe agent SDK’s guardrails, run in Workflow code, which must be deterministicA step in your code, journaled like any otherDeclared on an agent or a tool: a regex, a model as judge, a worker, or a policy service
Human approvalAn interrupt. The node runs again on resumeThe Workflow waits for a Signal or an UpdateA durable pause, resumed by the answerA flag on a tool, or a human task with a form
Other agentsSubgraphs and handoffsHandoffs, agents as tools, and NexusDurable calls between agents and servicesNine strategies, and one task for deployed and A2A agents
What you can seeThe compiled graph, drawn, and traces in LangSmithThe Event History of a runThe journal of a runThe graph before a run, and the run on it, with the steps still to come
Rerun from a pointTime travel from a checkpointReset to a point in the Event HistoryRestart from a prefix of the journalRerun from any task, with changed input

The line between them is who holds the agent’s loop. In LangGraph, Temporal, and Restate the loop is code that you deploy, and the engine makes that code durable. Each has its own form of checks, approvals, and calls to other agents, as the table shows. Temporal and Restate both describe teams building a shared platform for many agents on them.

In Conductor the loop becomes a graph that the server holds. Guardrails, approvals, model and MCP calls, and A2A agents are tasks in that graph. A run can therefore be read, limited, and rerun without reading the agent’s code, and an agent or workflow can be defined at run time and started with no deploy. The comparison pages go through each trade-off with its source.

AI agent orchestration best practices: a production checklist

  1. For each step, is it written down who decides: the model or the definition?
  2. Does every agent have a turn limit, a token budget, and a time limit?
  3. Which tools can write? What checks their arguments, and who approves?
  4. Is every tool that writes safe to call twice? Where does its idempotency key come from?
  5. What validates an agent’s output before anything acts on it?
  6. What happens when an approval is never answered?
  7. If a step fails after a write, what undoes the write?
  8. Can you open one run and see every prompt, tool call, and decision?
  9. What happens to runs in progress when you deploy a new version?
  10. Which agent can reach which systems, and with whose credentials?

Frequently asked questions

What is AI agent orchestration?

AI agent orchestration is the coordination of AI agents, the tools they call, and the services and people around them, so that work happens in the right order, within set rules, and with a record. It covers what one agent does with its tools and how several agents work together. It is also called agent orchestration and agentic orchestration.

What is agentic orchestration?

Agentic orchestration is another name for AI agent orchestration. It is used mostly by process-automation vendors, and it stresses the process around the agents: AI agents, people, and systems coordinated from the first step of a business process to the last, under rules the agents cannot skip.

How does agent orchestration work?

On two levels. Inside an agent, a runtime runs a loop: it calls a model, executes the tool the model asks for, checks the call against guardrails and limits, and repeats until the model answers. Around the agents, a workflow decides when each agent runs, validates what it returns, and connects it to services, people, and other agents.

What are the types of AI agent orchestration?

They sort two ways. By who decides the next step: the definition (sequential, parallel), a model (router, handoff, supervisor, swarm), or both (evaluator loop, group chat, plan and execute). By shape: centralized, where one supervisor directs the others, decentralized, where agents hand work to each other, and hierarchical, where supervisors direct supervisors.

Is AI agent orchestration the same as multi-agent orchestration?

No. Multi-agent orchestration is one part of it: deciding which of several agents runs next. AI agent orchestration also covers a single agent’s loop, its tools, guardrails, and limits, and the workflow that connects agents to services and people.

How is AI agent orchestration different from an agent framework?

A framework such as LangGraph or the OpenAI Agents SDK is where you write an agent: its prompts, tools, and loop. Orchestration is where the agent runs in production, with saved state, retries, approvals, limits, and a record, next to the services it depends on. The two work together, and an agent written in a framework can be run by an orchestrator.

What is the difference between AI agent orchestration and workflow orchestration?

Workflow orchestration coordinates the steps of a process across services and people, with the path set in advance. AI agent orchestration is workflow orchestration in which some steps are agents, plus the orchestration that happens inside each agent as a model chooses its tools.

What is the difference between agent orchestration and choreography?

In orchestration, one coordinator decides what runs next and holds the state of the whole run. The coordinator is a workflow or a supervising agent. In choreography there is no coordinator: each agent reacts to messages or events from the others, as in a swarm. Orchestration is easier to observe, limit, and recover. Choreography is looser, and harder to reason about when a step fails.

Which framework is used for agent orchestration?

It depends on the level. To write an agent, common frameworks are LangGraph, CrewAI, the OpenAI Agents SDK, Google ADK, and Microsoft Agent Framework. To run agents in production with saved state, approvals, and other services, teams use a durable workflow engine such as Conductor or Temporal, often with one of those frameworks on top.

Is there open-source AI agent orchestration?

Yes. The agent frameworks LangGraph and CrewAI are open source under the MIT license. So are engines that run agents durably: Temporal under MIT, and Conductor under Apache 2.0. All four can be run on your own infrastructure.

What are the biggest challenges of AI agent orchestration?

Non-determinism, because the same input can take different paths. Side effects, because a retried tool call can repeat a write. Failures and long waits in the middle of a run. Cost, which grows with every turn. Security, because text an agent reads can carry instructions. And testing, because there is no single correct output to assert on.

How do you measure AI agent orchestration?

Measure outcomes and behavior together: the share of runs that finish correctly, turns and tokens per run, tool errors and retries, guardrail and limit trips, how long approvals wait, and the cost of a completed run. Read them per step, from the record of each run.

Is agent orchestration the same as an agent runtime?

No. A runtime executes agents in production: it handles lifecycle, recovery, durable state, and concurrency. Orchestration decides what runs next and under what rules: which tool, which agent, which approval. A platform can provide both, and a production system needs both.

What is the difference between agent orchestration and an agent harness?

A harness is the software around one model that turns it into an agent: its prompts, tool definitions, loop, and context handling. Orchestration decides what runs next and under what rules. A harness orchestrates one agent’s tools. An orchestration layer also coordinates many agents, services, and people, and keeps the state of the run.

What is a durable agent?

An agent whose every model call and tool call is saved as it completes. If a call fails, a worker dies, or the run waits two days for a person, the agent continues from the last saved step instead of starting over. Durable agents are what make long-running agents safe to operate.

Can a non-deterministic agent run under deterministic control?

Yes, and that is the purpose of the outer level. The workflow fixes what happens before and after the agent, validates the agent’s answer as data, and owns every write. The model stays free to decide inside its step, and cannot change the path around it.

Does AI agent orchestration require MCP or A2A?

No. MCP is a standard way for a model to reach tools, and A2A is a standard way for one agent to call another. Both make integration easier, and neither decides what runs when. A tool can also be an ordinary HTTP call or a worker.

Where to go next