Workflow vs agent: code decides the path, or the model does
A workflow runs model calls and tools along a path fixed in code, while an agent lets the model decide its own next step and which tool to call; workflows suit tasks with predictable steps, and agents suit tasks whose steps cannot be known in advance.
Checked
This is the most consequential design choice in an agentic system, and the one where Anthropic, OpenAI and Google agree most. All three say to start with the simplest design that works and reach for an agent only when the steps cannot be predicted.
They differ on where control should live once a system grows. Anthropic and OpenAI lean on the model loop. Google's 2026 framework pushes deterministic routing with model steps inside it.
What each one is
Workflow
Model calls and tools orchestrated through code paths set in advance. Anthropic names five common patterns: prompt chaining, routing, parallelisation, orchestrator-workers and evaluator-optimizer.
Agent
A model that directs its own process and tool use, looping until the goal is met or it hands off. The path is decided at run time.
What the three labs advise
Anthropic
Begin with the simplest thing that works, and use agents for open-ended problems where the number of steps cannot be predicted.
OpenAI
Build an agent only where deterministic approaches fall short: nuanced judgement, rule sets too complex to maintain, or heavy unstructured data.
Google Cloud
Predictable tasks, or anything one model call can do, are often cheaper without an agent.
Google ADK 2.0
Model loops are slow, costly and variable when used for routing and error handling. A graph of deterministic and model nodes cut tokens by about 50% and latency by about 20% in Google's refund example, and separating control flow from the model limits prompt-injection impact.
The hybrid most systems use
Production systems are rarely pure. A common shape is a workflow for the predictable spine, such as intake, validation, routing and record-keeping, with an agent inside the steps that need judgement, such as investigating an exception or drafting a response from several sources.
Motiontic's engineers draw that line per step, using two questions: can the steps be written down in advance, and what does a wrong step cost? The answer is tested with evals on the client's real cases, and steps move from agent to workflow when the agent keeps taking the same path.
A workflow compared with an agent
| Workflow | Agent | |
|---|---|---|
| Who decides the next step | Code | The model |
| Predictability | Same path every run | Path varies with the input |
| Cost and latency | Lower and stable | Higher and variable |
| Debugging | Follow the code path | Read the trace of each run |
| Fits | Known steps, high volume, strict rules | Open-ended tasks needing judgement |
| Fails when | Inputs fall outside the designed paths | Context grows and the loop drifts |
Common questions
What is the difference between a workflow and an agent?
In a workflow, code fixes the sequence of model calls and tools. In an agent, the model decides its own next step and which tool to call. Anthropic draws this distinction in its guide to building effective agents.
When should an agent be used instead of a workflow?
When the steps cannot be predicted in advance, when the task needs judgement, or when inputs are messy and unstructured. Anthropic, OpenAI and Google all advise a workflow or a single model call wherever the path is predictable.
What is an agentic workflow?
An agentic workflow is a fixed sequence or graph of steps in which some steps call a model. Google's ADK 2.0 uses the term for graphs that mix deterministic routing nodes with model nodes.
Is a workflow cheaper than an agent?
Usually. A workflow makes a known number of model calls per run. In Google's ADK 2.0 refund example, moving routing out of the model loop into a graph cut tokens by about 50% and latency by about 20%.
Can a workflow contain an agent?
Yes, and many production systems do. The workflow handles the predictable steps and calls an agent for the step that needs judgement, then takes back control.
Related
Agentic workflow
Model calls on a path set in code: predictable, cheaper and easier to test than a free-running agent.
Single Agent vs Multi-Agent
One loop with good tools, compared with several agents splitting the work.
AI Agents vs Agentic AI
One system that decides its own steps, compared with the wider category of AI that acts.
AI agent development
Agents that do real work for users, with the evals, traces and guardrails to keep them in production.
Four levels of AI in a product
Why most products stop at a chatbot, and what levels three and four take.
Running agents that have to hold up?
Describe the agent, the systems it touches and what it must never get wrong. The first call is with a lab engineer, who will say plainly whether it is ready for production, and whether Motiontic is the right team.