Guide · Agentic workflows

AI workflow vs AI agent: who decides the next step — your code or the model.

In an AI workflow, the steps are fixed and AI works inside them. In an AI agent, the model chooses the next step itself. Most production systems combine the two.

Anthropic’s widely used definitions draw the line at control: workflows run on predefined code paths; agents direct their own process and tool use. That single difference decides cost, predictability, testing and audit. This guide shows the patterns on each side, builds one invoice process both ways, and gives a test for choosing.

Updated · 6 sources

Code decidesModel decides
12345
  1. ScriptEvery step and branch written in code. No model.
  2. Prompt chainFixed steps; a model reads or writes inside some of them.
  3. RoutingA model classifies the input; code sends it down a fixed path.
  4. Orchestrator-workersA model splits the task at run time; workers handle the parts.
  5. AgentA model chooses each next tool from what the last one returned.

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

An AI workflow is a process whose steps and order are fixed in advance, with a language model doing specific jobs inside them — reading a document, classifying a request, drafting a reply. An AI agent is a system in which the model decides the next step itself, choosing tools and continuing until the goal is met. In AI workflow vs AI agent, the workflow is predictable and cheap to audit; the agent handles paths no one could write down in advance.

Side by side

AI workflow vs AI agent, defined by who controls the path.

Google’s agent toolkit makes the same split in code: its workflow agents run sub-agents in sequence, in parallel or in a loop “without consulting an AI model” for the orchestration, while model-driven agents decide for themselves.

predefined path

AI workflow

“Systems where LLMs and tools are orchestrated through predefined code paths.” The model does a job; the code decides what comes next.

  • Same steps for every input
  • Model calls only where placed
  • Each step testable on its own
  • Fails at a known step
model-directed

AI agent

Systems where models “dynamically direct their own processes and tool usage”. The model decides what comes next.

  • Path differs from case to case
  • Model called on every step
  • Tested end to end, many times
  • Fails in ways that vary
Code written in advanceWho picks the next stepThe model, at run time
Only if a branch exists for itHandles a new kind of caseYes, within its tools
High: same input, same pathPredictabilityLower: runs vary
Known in advanceCost per itemGrows with the steps it takes
The path is the designAuditThe path must be recorded per run
Edit a stepChanging itEdit instructions and tools, then re-test
Five patterns

Five AI workflow patterns before you need an agent.

Anthropic names five workflow patterns it has seen work in production. Each keeps control in code while putting a model where judgement is needed; the sixth card is the point where a workflow stops being enough.

01extract → check → draft

Prompt chaining

A task split into fixed steps, each model call working on the last one’s output, with checks between.

02triage

Routing

A model classifies the input and code sends it to the step built for that kind.

03sectioning · voting

Parallelisation

Independent parts run at once and are combined in code — or the same task runs several times and the answers are compared.

04dynamic split

Orchestrator-workers

A model breaks the task into parts at run time and hands each to a worker, then combines what they return.

05draft ↔ review

Evaluator-optimizer

One model drafts, another critiques against criteria, and the loop repeats until the draft passes.

06last resort

Agent

When none of these fit because the steps cannot be known in advance, let the model direct the work.

One process, both ways

One invoice process built as an AI workflow and as an AI agent.

Accounts payable receives a supplier invoice. It must be read, matched to a purchase order, and then paid, held or rejected. The process is the same every time; the invoices are not.

As an AI workflow

  1. Receive

    A new invoice arrives in the mailbox.

    trigger
  2. Extract

    A model reads supplier, totals and lines into typed fields.

    AI
  3. Match

    Code finds the purchase order and compares totals.

    code
  4. Decide

    A model picks pay, hold or reject, with a confidence.

    AI
  5. Route

    Code pays, or sends the invoice to a person to review.

    code

As an AI agent

  1. ReadThe model reads the invoice and the instructions.
  2. ChooseIt picks a tool: find the order, look up the supplier, check payments.
  3. ActThe tool runs; the result comes back.
  4. JudgeIt decides whether it has enough to pay, hold or reject.

Back to choosing, with each result — until the agent decides the invoice is handled or asks a person.

The workflow fits this process better. The path is known, so fixing it makes every run cheaper, faster and easier to audit, and the model is used only for reading and one judgement. The agent earns its place when exceptions vary — a disputed delivery, a missing order, a supplier who changed name.

Cost, reliability, risk

What an AI agent costs that a workflow does not.

Autonomy is paid for in tokens, variance and testing effort, which is why Anthropic advises finding “the simplest solution possible” and adding complexity only when needed. The figures below show the token cost and how many agentic projects analysts expect to be stopped.

~4×
the tokens of a chat interaction used by a typical agent, in Anthropic’s experience with its own systems
Anthropic, 2025
>40%
of agentic AI projects Gartner predicts will be canceled by the end of 2027, over costs, unclear value or weak risk controls
Gartner, 2025
~130
of the thousands of vendors selling agentic AI that Gartner estimates are real; the rest it calls “agent washing”
Gartner, 2025

Errors compound along an unchecked path. Our arithmetic, not a measurement: if each step is right 95% of the time, independently, ten unchecked steps succeed end to end about 60% of the time (0.95 to the power of 10 ≈ 0.60). A workflow puts a check after each step by design; an agent needs the same checks built into its loop.

Decision guide

AI workflow vs AI agent: how to choose for each process.

OpenAI lists three signs an agent is warranted: complex decisions with exceptions, rules too tangled to maintain, and heavy reliance on unstructured data. Without them, it says, a deterministic solution may suffice.

High stakes
Workflow with a review stepPayments, claims, onboarding: fixed steps, AI to read and decide, a person on the risky ones.AI workflow
Agent with approvalsDisputes, investigations, exceptions: the model chooses lookups; changes wait for a person.AI agent
Low stakes
Plain workflowTagging, routing, summaries: fixed steps, one model call each.AI workflow
AgentResearch, internal questions across systems: let the model explore within read-only tools.AI agent
Path known in advancePath differs case by case

Can you draw the process as boxes and arrows before it runs?

Yes, every timeBuild a workflow. Put a model only in the boxes that read, classify or draft.
Mostly, with exceptionsBuild a workflow, and give the exception branch to an agent or a person.
No, it depends on what is foundUse an agent with granted tools, stopping rules and approvals on changes.Read more →
On Botminds

How Botminds puts agents inside workflows, and workflows inside meshes.

On Botminds an agentic workflow is an XFlow: a graph of steps on a canvas that run code, call systems, run an agent or make a typed decision. The building blocks nest, and each keeps its own rules wherever it is placed.

How the building blocks nest
01
Agent meshruns workflows as members, in thousands of parallel copies
volume
02
XFlowa fixed graph of steps, started by a schedule, an event or a new document
workflow
03
Agent stepruns any agent in the project, with its own tools, model and record
agent
04
Typed decisionone judgement with a probability; below 0.70 it is marked unsure and the code routes it to a person
decision
05
Code and system stepsPython, SQL and API calls: exact, cheap and easy to audit
deterministic

Read agentic workflows for the full design, and see the workflow pattern and XFlows and pipelines in the Academy.

Questions people ask

AI workflow vs AI agent: common questions.

The technology behind itAgentic workflowsFixed steps, AI where judgement counts
What is the difference between an AI workflow and an AI agent?

In AI workflow vs AI agent, a workflow fixes the steps and their order in code and uses a model inside specific steps. An agent lets the model choose each next step and tool at run time until the goal is met.

Is an agentic workflow the same as an AI agent?

No. An agentic workflow keeps a defined sequence of steps and puts agents or model calls inside the steps that need judgement. An AI agent has no fixed sequence; the model directs its own process.

When should I use an AI agent instead of a workflow?

When the path cannot be written down in advance: the next lookup depends on what the last one found, exceptions vary, or the input is open-ended. If you can draw the process as boxes and arrows, build a workflow.

Are AI workflows cheaper than AI agents?

Usually. A workflow calls a model only where it is placed, so the cost per item is known. An agent calls the model on every step and its cost grows with the path it takes; Anthropic reports agents use about four times the tokens of chat.

What are examples of AI workflows?

Invoice to payment, claims intake, contract renewal checks and supplier onboarding: each runs the same steps every time, with a model reading documents or making one judgement inside a step.

What are examples of AI agents?

Investigating a payment dispute across several systems, answering an open question from company data, researching a topic across many sources — tasks where the next step depends on what was just found.

Can an AI agent be part of a workflow?

Yes, and it is the most common enterprise design. The workflow fixes the order and the checks; one step runs an agent to handle the part that needs exploration, and its answer becomes that step’s output.

What did Anthropic say about workflows vs agents?

Anthropic defines workflows as LLMs and tools orchestrated through predefined code paths, and agents as LLMs that dynamically direct their own processes and tool usage. It advises starting with the simplest solution and adding agents only when needed.

See it on
your own work.

Bring one process and its documents. We’ll show you the agents, the controls and the record, running on your data.