Orchestration vs Automation vs Frameworks
Orchestration decides what runs, in what order, with which state, and what happens when something fails.
Agent orchestration is the control layer that sequences model calls, tools, agents and people, keeps task state, enforces limits and handles failure. Workflow automation follows predefined paths. An agent framework helps you build the model-driven parts. A workflow engine runs long processes reliably. Put certainty in code, use model judgment only where the input varies, and add each product when a stated need appears.
What you will learn: what orchestration covers, how it relates to automation, frameworks and workflow engines, a worked hybrid design, and how to decide what to use.
Prerequisites: The Agent Loop: Observe, Reason, Plan, Act, Reflect and basic programming.
What orchestration does
A single prompt needs no conductor. Once a task has several steps, tools, waits or participants, something has to keep it together. That something is the orchestrator. It may be fifty lines of your own code or a dedicated service.
| Responsibility | Question it answers |
|---|---|
| Sequencing | What happens next? |
| State | What has happened and what do we know? |
| Routing | Which model, tool, agent or person handles this? |
| Limits | How many steps, how long, how much money? |
| Failure handling | Retry, undo, wait, escalate or stop? |
| Permissions and approvals | May this action happen now? |
| Observation | Can someone see and explain a run? |
Orchestration vs workflow automation
Workflow automation has existed for decades: when something happens, run defined steps with defined branches. It is predictable, testable and cheap to run. Agent orchestration adds participants whose output and chosen path can vary. The two are not rivals; most useful systems mix them.
| Aspect | Workflow automation | Agent-driven work |
|---|---|---|
| Path | Designed in advance | Partly chosen at run time |
| Inputs | Structured and expected | Language, documents, surprises |
| Testing | Exact expected results | Repeated runs and graded outcomes |
| Cost per run | Low and stable | Higher and variable |
| Failure style | Stops on the unexpected | May continue plausibly and wrongly |
| Best use | Rules that must hold | Interpretation and open-ended steps |
Anthropic's guidance on building agents draws a similar line between workflows, where code sets the path, and agents, where the model directs its own process. It recommends the simplest approach that works and adding complexity only when it demonstrably helps.
A hybrid you can run
Here code owns the order of steps. A stand-in for a model classifies a customer's message, and rules decide what follows.
"""Code owns the order of steps. A model decides one thing inside it."""
def classify(text):
"""Stand-in for a model call. It may return something unexpected."""
if "broken" in text:
return "damaged"
if "late" in text:
return "delayed"
return "I think the customer is upset"
def handle(order, text, log):
log.append("verify identity")
if not order["verified"]:
return "stop: identity not verified"
log.append("classify")
reason = classify(text)
if reason not in {"damaged", "delayed"}:
return "person: unclear reason"
log.append("apply policy")
amount = order["total"] if reason == "damaged" else 5
if amount > 50:
return f"approval needed: refund {amount}"
log.append("refund")
return f"refunded {amount}"
orders = [({"verified": True, "total": 30}, "it arrived broken"),
({"verified": True, "total": 200}, "it arrived broken"),
({"verified": True, "total": 200}, "so late again"),
({"verified": True, "total": 20}, "give me my money"),
({"verified": False, "total": 20}, "broken")]
for order, text in orders:
log = []
print(f"{handle(order, text, log):<32}{' > '.join(log)}")
Output:
refunded 30 verify identity > classify > apply policy > refund
approval needed: refund 200 verify identity > classify > apply policy
refunded 5 verify identity > classify > apply policy > refund
person: unclear reason verify identity > classify
stop: identity not verified verify identity
Five requests take four different outcomes, and the log shows exactly which steps ran. Identity is checked before the model sees anything. When the classifier answers with something outside its allowed set, the case goes to a person instead of being guessed at. A large refund stops for approval no matter how the message is worded. Real code would also check the order on the server, give each refund an operation key so it cannot happen twice, and record the approval before acting.
If a rule must always hold, such as identity first or approval above a limit, express it in code or policy. A sentence in a prompt is a request, not a guarantee.
Map a process before automating it
Take one real request and write down every step a person performs today, including the checks they make without thinking. For each step note what starts it, what information it needs, what it changes, how long it can wait and what happens when it goes wrong. Then mark the steps that need interpretation. The result usually shows that most of a process is ordinary coordination and a few steps involve language or judgment.
| Step | Decider | Effect | If it fails |
|---|---|---|---|
| Receive request | Code | Creates a task record | Retry delivery |
| Understand the request | Model, validated | None | Send to a person |
| Check eligibility | Code | None | Stop with a reason |
| Draft a reply | Model | Draft only | Regenerate or hand over |
| Approve above a limit | Person | Records a decision | Expire and escalate |
| Carry out the action | Code | Changes a system once | Look up outcome, then decide |
The table is an invented returns process. Its value is that every row has an answer in the last column. Mapping also reveals steps that exist only because of an old limitation, which are better removed than automated. See Process Discovery and Use Case Selection.
Agent framework vs workflow engine
Product categories overlap and change quickly, so compare capabilities rather than labels.
| Capability | Agent framework | Workflow engine |
|---|---|---|
| Main concern | Model calls, tools, context, agent patterns | Reliable execution of long processes |
| State | Conversation and graph state; persistence varies | Recorded history or database by design |
| Retries and timers | Varies by product | Core feature |
| Waiting days | Needs persistence support | Normally supported |
| Model features | Rich | Usually supplied by your code |
| Operations | Often a library inside your service | Often a server or managed service |
Some agent frameworks now persist their state. LangGraph, for example, documents checkpointing with durability modes that trade write frequency against performance. Workflow engines such as Temporal are built so that a workflow can run for months or longer and recover after failures, in return for rules about how workflow code is written. The two can be combined: a durable workflow calls an agent as one of its steps. See Durable Execution, Checkpoints and Approvals.
Nearby ideas
| Term | What it is |
|---|---|
| Job scheduler | Starts tasks at set times |
| Message queue | Holds work until a consumer takes it |
| Data pipeline orchestrator | Runs dependent data jobs |
| Business process management | Models and tracks organizational processes with people |
| Robotic process automation | Drives user interfaces where no API exists |
| Container orchestration | Places and restarts software on machines |
If your organization already runs one of the first five well, it may provide most of what your agent needs around it. Container orchestration solves a different problem: restarting a process does not resume a half-finished task.
Four levels of orchestration
- Plain code: functions, conditions and a database row for status. Good for short tasks.
- Explicit graph or state machine: named states and allowed moves. Good when paths branch or loop. See Graphs, State Machines, Parallelism and Sagas.
- Queue and workers: work survives restarts and bursts. See Event-Driven and Background Agents.
- Durable execution: progress is recorded step by step so long runs resume. See Durable Execution, Checkpoints and Approvals.
Move up when a requirement forces you to, and note which one it was.
Decision guide
| If you need | Start with |
|---|---|
| Fixed steps on structured data | Ordinary code or existing automation |
| One interpretive step inside fixed steps | Automation plus one model call |
| Model chooses tools within one request | A small agent loop or agent SDK |
| Branching, cycles and inspectable state | A graph library |
| Runs lasting hours or days, crash recovery | Durable execution |
| Bursts of background work | Queue and workers |
| Human tasks across departments | The process platform people already use |
Central coordination or reaction to events
Two broad styles appear in distributed work. In orchestration, one component knows the process and tells participants what to do. In choreography, each participant reacts to events and no single component holds the whole sequence.
| Aspect | Central orchestration | Choreography |
|---|---|---|
| Seeing a run | One place to look | Pieced together from events |
| Changing the process | Change the coordinator | Change several participants |
| Coupling | Coordinator knows participants | Participants know event types |
| Failure handling | Explicit in one place | Spread out |
| Risk | A coordinator that does too much | Hidden loops and gaps |
For agent work with limits, approvals and audit, a visible coordinator is usually easier to defend. Events remain useful for starting runs and announcing results, as in Event-Driven and Background Agents.
Where to draw the boundary
For each step ask who should decide. Use code when the rule is known, errors are costly or audit demands the same answer every time. Use a model when the input is varied language or the useful next step cannot be listed in advance. Use a person when judgment carries accountability. Give model-driven steps a typed output, a limited tool set, a budget and a check before their result affects anything.
Review the boundary with data. If a model step nearly always chooses the same option, replace it with a rule and keep an exception path. If rules keep growing to cover variations in wording, a model step may be cheaper to maintain.
Own your state
Whatever tool you use, keep business facts in your own systems with your own identifiers: order, task, approval, action taken. Treat framework state as working memory for a run. This keeps reporting, support and migration possible when libraries change. Document the states a task may be in so that a person can answer "where is it and why?" without reading code.
People are part of the orchestration
Design human steps with the same care as automated ones. Say who receives the task, what they see, which choices they have, how long they have and what happens if they do nothing. Give them the evidence and the exact proposed action, not a summary that invites a quick yes. Count the expected volume against the people available; a gate that creates a backlog will either stall the process or be approved without reading.
Also provide ways for people to intervene without being asked: pause a run, correct a field, take over or cancel. Record each intervention, because a pattern of manual fixes shows where the design needs work. See Human-in-the-Loop and Approval Gates.
Plan the failure paths first
For each step write what happens when it times out, returns nonsense, is refused or succeeds without a reply. Decide which can be repeated safely and which need a lookup first, as in Reliable Tool Execution and Error Recovery. A design that shows only the successful path is unfinished.
Limits belong to the orchestrator
Set a maximum number of steps, a time limit, a spend limit and a limit on repeated identical actions for every run. Count across all agents and branches. Define what the user receives when a limit is reached: what was completed, what was not and how to continue. A stop control should take effect before the next action, and operators need a way to pause new runs during an incident. Agent Decisions: Confidence, Stopping, Loops and Budgets explains stopping rules inside a single agent.
Evaluating a tool before adopting it
- Write three real scenarios, including a crash and a long approval wait.
- Build the smallest version of each in the candidate and in plain code.
- Kill the process mid-step and inspect what happens on restart.
- Change the workflow while a run is waiting.
- Check how you test, trace, secure and delete data.
- Price operation and estimate the cost of leaving.
See Choosing Frameworks: Lock-In, Upgrades and Benchmarks.
The first design asks one agent to run the whole process from an instruction document, and steps are sometimes skipped. The team moves the sequence into a workflow: collect documents, extract fields with a model, validate by rules, check sanctions through a service, request approval and create the record. The model now handles reading and drafting emails. Each run shows its stage and the order of checks cannot be talked around.
A sensible path from prototype to service
- Prototype: a script with read-only tools and a handful of real examples.
- Structure: separate steps, typed outputs, explicit status and limits.
- Persist: save state, add operation keys and make restart safe.
- Decouple: queue long work and report progress.
- Harden: permissions, approvals, tracing, evaluation and failure tests.
- Operate: versioned releases, dashboards, runbooks and an owner.
Do not skip from the first stage to a service because the demonstration went well. A demonstration shows that success is possible; the later stages show what happens the rest of the time.
Warning signs in a design
| You notice | Likely problem |
|---|---|
| A long prompt lists steps that "must" happen in order | Control flow belongs in code |
| Support cannot tell where a request is | No explicit state |
| A restart loses work or repeats actions | No recorded progress or operation keys |
| Costs vary wildly between similar requests | Unbounded loops |
| Every change needs prompt surgery | Rules mixed with language instructions |
| Only one person understands the flow | Missing diagram and tests |
Common mistakes
- Letting a model decide order that never varies.
- Adopting a platform before naming the requirement.
- Assuming a framework persists state when it does not by default.
- Keeping business records only inside framework state.
- No limit on steps or spend.
- Designing only the success path.
- Mistaking process restarts for task recovery.
Checklist
- Each step has a named decider: code, model or person.
- Mandatory rules are enforced outside prompts.
- Model outputs are validated before use.
- Task state is explicit and queryable.
- Limits and failure paths are defined.
- Tool choice is backed by tested scenarios.
- One run can be traced from start to finish.
Frequently asked questions
Is orchestration the same as multi-agent design?
No. A single agent inside a workflow needs orchestration, and a multi-agent design is one of the things an orchestrator may coordinate.
Can a model be the orchestrator?
It can plan and delegate. Limits, permissions, state and mandatory steps should still be held by code.
Do I need a framework to start?
No. A loop, a few functions and a status field teach the essentials and show what you later need.
When is plain automation the better choice?
When inputs are structured, rules are known and a wrong answer is costly. It is cheaper to run and easier to test.
References and further reading
- Anthropic: building effective agents
- LangGraph: durable execution
- Temporal: workflows
- Microsoft: AI agent orchestration patterns
Next steps
Graphs, State Machines, Parallelism and Sagas
Describe paths precisely.
Durable Execution, Checkpoints and Approvals
Survive crashes and waits.
Choosing Frameworks: Lock-In, Upgrades and Benchmarks
Compare frameworks.