Orchestration vs Automation vs Frameworks

Orchestration decides what runs, in what order, with which state, and what happens when something fails.

BeginnerIntermediateExpert · 12 min read · Last updated:

In short

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.

Beginner The control layer

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.

ResponsibilityQuestion it answers
SequencingWhat happens next?
StateWhat has happened and what do we know?
RoutingWhich model, tool, agent or person handles this?
LimitsHow many steps, how long, how much money?
Failure handlingRetry, undo, wait, escalate or stop?
Permissions and approvalsMay this action happen now?
ObservationCan someone see and explain a run?
Request or event
Orchestratorstate, rules, limits
Models and agentsinterpret and propose
Tools and servicesread and act
Peopleapprove and decide
Participants do work; the orchestrator holds the thread.

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.

AspectWorkflow automationAgent-driven work
PathDesigned in advancePartly chosen at run time
InputsStructured and expectedLanguage, documents, surprises
TestingExact expected resultsRepeated runs and graded outcomes
Cost per runLow and stableHigher and variable
Failure styleStops on the unexpectedMay continue plausibly and wrongly
Best useRules that must holdInterpretation 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.

Put certainty in code

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.

StepDeciderEffectIf it fails
Receive requestCodeCreates a task recordRetry delivery
Understand the requestModel, validatedNoneSend to a person
Check eligibilityCodeNoneStop with a reason
Draft a replyModelDraft onlyRegenerate or hand over
Approve above a limitPersonRecords a decisionExpire and escalate
Carry out the actionCodeChanges a system onceLook 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.

Intermediate Tools of the trade

Agent framework vs workflow engine

Product categories overlap and change quickly, so compare capabilities rather than labels.

CapabilityAgent frameworkWorkflow engine
Main concernModel calls, tools, context, agent patternsReliable execution of long processes
StateConversation and graph state; persistence variesRecorded history or database by design
Retries and timersVaries by productCore feature
Waiting daysNeeds persistence supportNormally supported
Model featuresRichUsually supplied by your code
OperationsOften a library inside your serviceOften 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

TermWhat it is
Job schedulerStarts tasks at set times
Message queueHolds work until a consumer takes it
Data pipeline orchestratorRuns dependent data jobs
Business process managementModels and tracks organizational processes with people
Robotic process automationDrives user interfaces where no API exists
Container orchestrationPlaces 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

  1. Plain code: functions, conditions and a database row for status. Good for short tasks.
  2. Explicit graph or state machine: named states and allowed moves. Good when paths branch or loop. See Graphs, State Machines, Parallelism and Sagas.
  3. Queue and workers: work survives restarts and bursts. See Event-Driven and Background Agents.
  4. 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 needStart with
Fixed steps on structured dataOrdinary code or existing automation
One interpretive step inside fixed stepsAutomation plus one model call
Model chooses tools within one requestA small agent loop or agent SDK
Branching, cycles and inspectable stateA graph library
Runs lasting hours or days, crash recoveryDurable execution
Bursts of background workQueue and workers
Human tasks across departmentsThe 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.

AspectCentral orchestrationChoreography
Seeing a runOne place to lookPieced together from events
Changing the processChange the coordinatorChange several participants
CouplingCoordinator knows participantsParticipants know event types
Failure handlingExplicit in one placeSpread out
RiskA coordinator that does too muchHidden 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.

Expert Design judgment

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

  1. Write three real scenarios, including a crash and a long approval wait.
  2. Build the smallest version of each in the candidate and in plain code.
  3. Kill the process mid-step and inspect what happens on restart.
  4. Change the workflow while a run is waiting.
  5. Check how you test, trace, secure and delete data.
  6. Price operation and estimate the cost of leaving.

See Choosing Frameworks: Lock-In, Upgrades and Benchmarks.

Illustrative example: onboarding a supplier

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

  1. Prototype: a script with read-only tools and a handful of real examples.
  2. Structure: separate steps, typed outputs, explicit status and limits.
  3. Persist: save state, add operation keys and make restart safe.
  4. Decouple: queue long work and report progress.
  5. Harden: permissions, approvals, tracing, evaluation and failure tests.
  6. 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 noticeLikely problem
A long prompt lists steps that "must" happen in orderControl flow belongs in code
Support cannot tell where a request isNo explicit state
A restart loses work or repeats actionsNo recorded progress or operation keys
Costs vary wildly between similar requestsUnbounded loops
Every change needs prompt surgeryRules mixed with language instructions
Only one person understands the flowMissing 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

Next steps