- AGENTIC
- INSIGHTS
What Is AI Agent Orchestration? Architecture, Patterns, and Examples
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.
(opens the full-size image in a new tab) 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 orchestrates | A workflow orchestrates agents | |
|---|---|---|
| Who decides the next step | A model, while the run is in progress | The definition, written before the run starts |
| What is coordinated | Tool calls inside one agent | Agents, services, people, and events |
| The plan | Emerges turn by turn | Known in advance |
| State | The conversation history | The saved input and output of every step |
| Ends when | The model is done, or a limit trips | The definition reaches its last step |
| Suits | Open-ended work whose path cannot be listed | Work that must happen in order, with approvals and a record |
| Main risk | Wandering: loops, wrong tools, cost | Rigidity: 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 manages | Which means |
|---|---|
| Control flow | What runs next: the next tool, the next agent, the next step |
| State | What has happened so far, saved so that a run can continue after a failure |
| Tools and agents | How each one is called: schemas, credentials, timeouts, and retries |
| Policy | What is allowed: guardrails, limits, approvals, and permissions |
| Failure | What 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
(opens the full-size image in a new tab) - 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.
- Call the model. It returns text, or one or more tool calls. A tool call is a tool name and arguments as JSON.
- No tool call: finish. The text is the answer. It passes the output check and goes back to the caller.
- 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.
- 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
| Decision | Decided by |
|---|---|
| Which tool to call next, and with what arguments | The model |
| Whether the work is finished | The model |
| Which tools exist, and their schemas | The definition |
| Whether a particular call may run | The runtime, through guardrails |
| Whether a person must approve it first | The definition |
| How many turns, tokens, and tool calls the run may spend | The definition |
| What happens when a tool fails or times out | The runtime, through a retry policy |
| Which credentials a tool runs with | The 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.
| Position | What it catches | Typical outcome | |
|---|---|---|---|
| A | Agent input | Prompt injection, out-of-scope requests, sensitive data coming in | Block, or return a safe answer |
| B | Agent output | Leaked personal data, answers outside policy | Ask again with feedback, or send to a person |
| C | Tool input | Dangerous arguments, before a side effect happens | Reject before the tool runs |
| D | Tool output | Bad, oversized, or hostile data returned by a tool | Stop, 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.
| Limit | What it bounds |
|---|---|
| Turn limit | Runaway loops. If you set only one limit, set this one |
| Token budget | The cost of each model call, and how large the context may grow |
| Calls per tool | An agent that hammers one API |
| Time limit | A run that hangs |
| Tool allow-list | Reach: which systems the agent can touch at all |
| Allowed transitions | Which 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
(opens the full-size image in a new tab) The workflow treats an agent as a step whose output is not trusted until it has been checked:
- Validate the request before the agent sees it: its shape, the caller’s permissions, the IDs it refers to.
- Run the agent. Give it tools that read, and let it propose.
- 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.
- Approve. A person decides when the write is consequential.
- Write once, with an idempotency key.
- 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
(opens the full-size image in a new tab) 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
| Pattern | Model calls spent on routing | It ends when | How it goes wrong | In Conductor |
|---|---|---|---|---|
| Sequential | None | The last agent finishes | An early mistake is carried to the end | sequential |
| Parallel | None | Every branch has joined | One slow or failed branch holds the join | parallel |
| Router | One | The chosen agent finishes | A wrong classification gets no second look | router |
| Handoff | One for each transfer | The agent holding the conversation answers | A transfer to the wrong specialist, or back and forth | handoff |
| Supervisor | One for each delegation, and one to combine | The supervisor answers | Every result returns through one context, which fills | An agent given other agents as tools, with agent_tool |
| Swarm | One for each transfer | An agent answers instead of transferring | Agents pass the task around until a limit ends the run | swarm |
| Evaluator loop | One for each review | The reviewer passes the work, or a round limit is reached | A reviewer that never passes, or passes everything | A loop in the workflow, or a guardrail judged by a model |
| Group chat | One for each turn, when a model picks the speaker | A termination rule fires | A thread that grows until every turn is expensive | round_robin for a fixed rotation, manual when your code picks the speaker |
| Plan and execute | One to plan, and one for each replan | The plan is complete | A plan that is wrong from its first step | plan_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.
| Pattern | Anthropic | Microsoft | Google Cloud | OpenAI Agents SDK | LangChain |
|---|---|---|---|---|---|
| Sequential | Prompt chaining | Sequential | Sequential | Chaining | Custom workflow |
| Parallel | Parallelization | Concurrent | Parallel | Parallel execution | Custom workflow |
| Router | Routing | Handoff, as routing | Coordinator | Classify, then branch in code | Router |
| Handoff | — | Handoff | — | Handoffs | Handoffs |
| Supervisor | Orchestrator-workers | — | Hierarchical task decomposition | Agents as tools | Subagents |
| Swarm | — | — | Swarm | — | — |
| Evaluator loop | Evaluator-optimizer | Maker-checker loop | Review and critique | Evaluator 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.
| Kind | What it holds | Where it lives | How long |
|---|---|---|---|
| The run | The messages and tool results of the task in progress | Saved with the steps of the run | Until the run ends |
| The session | The conversation with one user, or on one case, across runs | A history keyed by a session ID | As long as the conversation |
| Long-term memory | What is worth keeping: preferences, past decisions, documents | A store that the agent searches, usually by meaning | Until 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
(opens the full-size image in a new tab) 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?
(opens the full-size image in a new tab) 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 order | The definition |
| moves money, sends a message, or changes a record | The definition, with an approval |
| depends on reading unstructured input | A model |
| has a path nobody can list in advance | A model, in a loop with limits |
| has to be explained to an auditor | The 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.
| Use | The model decides | The definition guarantees |
|---|---|---|
| Customer support and refunds | Whether a request qualifies, and what to tell the customer | An approval above a limit, one payment, a record of why |
| Software delivery with coding agents | How to plan, write, and fix a change | Tests pass, a person reviews, the merge happens once |
| Claims and document processing | What a document says, and what is missing | Required checks run, and an adjuster approves exceptions |
| Incident response | Which diagnostics to run, and the likely cause | No remediation without approval, and every action logged |
| Research and reporting | What to search, read, and conclude | Sources 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.
| Group | What it gives you | Examples |
|---|---|---|
| Agent frameworks | A way to write an agent: its prompts, tools, and loop | LangGraph, CrewAI, OpenAI Agents SDK, Google ADK, Microsoft Agent Framework, Pydantic AI |
| Durable workflow engines | A runtime that saves every step and survives failures and long waits | Conductor, Temporal, Restate, Camunda, Inngest |
| Hosted agent platforms | A cloud service that deploys and scales agents | Amazon Bedrock AgentCore, Microsoft Foundry Agent Service, Vertex AI Agent Engine |
| Process automation suites | Agents, people, and systems coordinated inside modeled business processes | UiPath 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 fails | What the runtime does | What you still design |
|---|---|---|
| A model call errors or times out | Retries that call, with backoff. Earlier steps are not run again | A retry policy and a response timeout for each model step |
| A step in an agent loop uses up its retries | Fails the loop. Retrying the loop starts its turns again | A turn limit, and tools that are safe to repeat |
| The model returns malformed output | Nothing: the call succeeded | A validation step after the model, before anything acts on its output |
| A tool times out, and the call may have worked | Retries it. The first request may still be in flight | Tools that are safe to call twice |
| A worker dies after a side effect, before reporting | Runs the task again | An idempotency key, so the second run does nothing |
| Nobody answers an approval | Waits, using no compute | A timeout and an escalation path |
| The same approval arrives twice | Rejects the second: the step is already complete | Nothing |
| A decision goes stale while the run waits | Nothing: the wait ended normally | A check, at the write, that what the decision rested on has not changed |
| One parallel branch fails | Retries that branch while the join waits | Whether the other branches should be canceled |
| The definition changes during a run | Runs in progress keep the version they started with | How runs already in progress move to the new version |
| The run lasts for weeks | Treats it as normal | Payload 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 BaseModelfrom 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)
@tooldef 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.
| Step | Type | What it guarantees |
|---|---|---|
crm_lookup | HTTP | The order total comes from the system of record, never from the model |
refund_agent | Agent | The model investigates and proposes. It has no tool that writes |
check_proposal | Inline | The answer is read as data. Anything unreadable, or more than the order total, fails the run |
route | Switch | No refund ends the run. More than $50 goes to a person |
approve_refund | Human | Anything other than an explicit approval ends the run, and so does three days with no answer |
issue_refund | Worker | One write, with a key that is the same on every retry, and none at all if the order has changed |
refund.issued | Event | The 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.
(opens the full-size image in a new tab) Three things in the record are worth reading closely.
- 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.
- 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.
- The refund ran once. A retry of
issue_refundwould 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 AgentRuntimefrom 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.
recordsaves 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_runbuilds a result from a list of events that you write, with no model and no server, and runs the real tool functions.
AI agent orchestration vs related terms
The orchestration layer, the harness, the runtime, and the durable agent are defined in their own sections above. These are the neighboring terms.
| Term | What it means | How it relates |
|---|---|---|
| Multi-agent orchestration | Coordinating several agents | One part of it: the patterns in Figure 4 |
| Agentic AI | AI systems that pursue goals by planning and acting | The wider category. Orchestration is the part that coordinates it |
| Agentic workflow | A workflow in which one or more steps are agents | The outer level, seen from the side of the process |
| Agentic process orchestration | A process engine coordinating agents, people, and systems | The name process-automation vendors give the outer level |
| Workflow orchestration | Coordinating the steps of a process across services and people | The base that the outer level builds on |
| LLM orchestration | Chaining prompts, retrieval, and model calls | The second stop in Figure 6. No agent loop is required |
| Durable execution | Saving every step so a run survives failure | What 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:
| Strategy | Who decides | What runs | Build it |
|---|---|---|---|
handoff | The model | One sub-agent, which takes over the conversation | |
router | The model | One sub-agent, with no conversation | Issue triage bot |
sequential | The definition | All of them, in order | Support ticket pipeline |
parallel | The definition | All of them, at once | Three reviewers, one PR |
swarm | The sub-agents | Each in turn, until one finishes | Support swarm |
round_robin | The definition | The next in rotation | Code review debate |
random | The definition | One, at random | Brainstorming session |
plan_execute | The model, then the definition | A planned sequence, replanned as results come in | |
manual | Your code | Whatever your code selects | Editorial 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.
| LangGraph | Temporal | Restate | Conductor | |
|---|---|---|---|---|
| Calls itself | An agent orchestration framework and runtime | A durable execution platform | A durable runtime for agents and backends | A durable workflow and agent runtime |
| The agent loop is | Nodes of a graph, in your code | Workflow code, replayed on Workers that you deploy | Handler code on your compute, with an agent SDK or your own loop | A workflow that the SDK compiles from your agent, or tasks in a definition |
| Model and tool calls | Calls inside nodes | Activities on Workers. Deterministic tools can run in the Workflow | Journaled steps in the handler | Built-in tasks on the server, or your workers |
| Guardrails | Middleware, built in for PII and human review, or your own | The agent SDK’s guardrails, run in Workflow code, which must be deterministic | A step in your code, journaled like any other | Declared on an agent or a tool: a regex, a model as judge, a worker, or a policy service |
| Human approval | An interrupt. The node runs again on resume | The Workflow waits for a Signal or an Update | A durable pause, resumed by the answer | A flag on a tool, or a human task with a form |
| Other agents | Subgraphs and handoffs | Handoffs, agents as tools, and Nexus | Durable calls between agents and services | Nine strategies, and one task for deployed and A2A agents |
| What you can see | The compiled graph, drawn, and traces in LangSmith | The Event History of a run | The journal of a run | The graph before a run, and the run on it, with the steps still to come |
| Rerun from a point | Time travel from a checkpoint | Reset to a point in the Event History | Restart from a prefix of the journal | Rerun 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
- For each step, is it written down who decides: the model or the definition?
- Does every agent have a turn limit, a token budget, and a time limit?
- Which tools can write? What checks their arguments, and who approves?
- Is every tool that writes safe to call twice? Where does its idempotency key come from?
- What validates an agent’s output before anything acts on it?
- What happens when an approval is never answered?
- If a step fails after a write, what undoes the write?
- Can you open one run and see every prompt, tool call, and decision?
- What happens to runs in progress when you deploy a new version?
- 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
- See how Orkes Conductor handles AI agent orchestration across frameworks, models, and clouds.
- Read What is durable execution? for what keeps a run’s progress safe, and What is workflow orchestration? for the process around the agents.
- Go deeper on two parts of this guide: building durable agents, from tools to deployment, and human-in-the-loop in agentic workflows.
- See how Conductor works as a workflow engine for AI agents.
- Run an agent you already have with the framework agents quickstart.

