Opinion
Workflows vs agents: start with the simplest thing that works
Most LLM features should be a fixed workflow, not an agent. How to tell which one you need, when an agent earns its cost, and the useful patterns in between.
Bookmark
Bookmarks are kept in your free account, so you can find this page again on any device.
Sign in to bookmarkOn this page
When a team decides to “add AI” to a product, the conversation often jumps straight to agents. Agents are exciting: give the model tools and a goal and let it work things out. But in our experience, and in the published advice of the companies building these models, most useful LLM features are not agents. They are workflows: code that calls a model at specific points, in a fixed order, with the program in charge.
This is not an argument against agents. It is an argument for choosing deliberately.
The difference
In a workflow, your code decides the steps. A support-ticket feature might classify the ticket with one model call, retrieve matching help articles with ordinary search, then draft a reply with a second call. The model never chooses what happens next.
In an agent, the model decides the steps. It receives the ticket and a set of tools (search help articles, look up the customer’s account, check order status) and calls them in whatever order it judges useful until it can reply.
Anthropic’s “Building effective agents” (December 2024) drew the same line and made the same recommendation: find the simplest solution possible, and only increase complexity when needed. Many teams found that advice correct the hard way.
Why workflows win more often than you expect
They are predictable. The same input goes through the same steps. When something goes wrong you know which step to look at.
They are testable. Each step has defined inputs and outputs, so you can write evals for each one. “The classifier labels billing tickets correctly 96% of the time” is a measurement you can improve. “The agent usually handles tickets well” is not.
They are cheaper and faster. A workflow makes exactly the calls it needs. An agent makes as many as it decides to, often re-reading and re-checking, and each call carries the growing context.
Failures are contained. A step that fails can retry, fall back or route to a human. An agent that goes wrong may take several confident steps in the wrong direction before anyone notices.
When an agent is worth it
Agents earn their extra cost and unpredictability when the path genuinely depends on what is discovered along the way. Signs you are in that territory:
- You cannot write down the steps in advance, because they vary from case to case in ways you cannot enumerate.
- The task involves investigation: debugging, research, working through an unfamiliar codebase.
- There is a reliable signal of progress (tests, a compiler, a search that does or does not find the answer) that lets the agent correct itself.
- Mistakes can be caught and undone before they matter.
Coding agents fit all four, which is why they are the most successful agents so far. A customer-facing bot that issues refunds fits almost none.
The patterns in between
The choice is not binary. Several well-known patterns sit between a single call and an open-ended agent, and they cover a lot of real products:
| Pattern | What it is | Example |
|---|---|---|
| Prompt chain | Fixed sequence of calls, each using the last one’s output | Outline, then draft, then edit |
| Routing | A first call classifies the input; code sends it to a specialised path | Billing questions to one prompt, bugs to another |
| Parallel calls | Independent calls run at once and are combined | Check a contract against five policies in parallel |
| Evaluator loop | One call produces, another checks against criteria, repeat a bounded number of times | Draft an answer, check it cites sources, revise once |
| Agent within a step | A workflow that hands one open-ended sub-task to a small, bounded agent | Pipeline that uses an agent only to investigate failed tests |
The last one is often the sweet spot: the overall process stays predictable, and the agent works only where its flexibility is needed, with tight tools and limits.
If you do build an agent
Constrain it. The habits that make agents dependable are mostly limits:
- Few, well-described tools. Each tool’s description is in context on every step. Ambiguous tools get misused.
- A step or cost limit that fits the task, not an arbitrary large number.
- Permissions in code. Read-only by default; approval for anything irreversible.
- Logging of every step, so you can see what it did and why.
- Evals on whole tasks, with a set of realistic cases you run after every change.
Our view
Start with one model call. If that is not enough, chain a few with code in between. Add routing, parallel calls or an evaluator loop when a specific problem calls for it. Reach for an agent when the work really is open-ended, and even then, keep it on a short lead.
The goal is a feature that works reliably, not a feature that uses the most impressive architecture. Users cannot tell the difference between a well-built workflow and an agent, except that the workflow is usually faster and makes fewer strange mistakes.
To see both ends in code, compare the fixed pipeline in RAG fundamentals with the agent in Build your first agent in Python.
Next steps
- Get the definitions straight in what is an AI agent?
- Deciding whether to split work across subagents or workers? Read Multi-agent systems: when one agent is not enough.
- If you do need an agent, choose a framework with agent frameworks compared.
- Before you split the work across several agents, read multi-agent systems: when to use more than one agent.
- Test whichever you build with evaluate AI agents.
- Keep each model call predictable with structured outputs.
Covers
Related
- What is an AI agent? A plain explanation
An AI agent is a language model that uses tools in a loop until a task is done. What that means in practice, what agents are good at and where they go wrong.
- Build your first agent in Python
Three tools, a hard turn limit, a clear stop condition and a log of every tool call it makes.
- Write your first LLM eval
Turn real outputs into a small test set, add code-based checks in promptfoo and run them in CI to catch regressions on every change.
- Get reliable JSON from an LLM with structured outputs
Describe the output as a schema, let the provider enforce it, validate it with Pydantic AI or the AI SDK, and handle failures.
- Agent frameworks compared: Claude Agent SDK, OpenAI Agents SDK, LangGraph, Pydantic AI, Mastra, Google ADK
Six agent frameworks on one fixed table: language, durable execution, tracing, MCP support and lock-in, with notes on which kind of project each one fits.