Workflows vs AI agents: which one does your problem actually need?
"Agent" is the word everyone reaches for — and often the wrong tool. A clear-eyed comparison of workflows vs agentic frameworks: the pros, the cons, the risks nobody demos, and how to choose.
The word "agent" has eaten the industry. Every LLM feature is now pitched as one, and every framework promises autonomous agents out of the box. But most problems that get solved with an agent would be cheaper, faster, and far more reliable as a workflow. Choosing the wrong one is one of the most expensive mistakes I see teams make — so let's draw the line clearly.
The real distinction
It's not about the framework you install; it's about who controls the flow of execution. In a workflow, you do — LLM calls are orchestrated through predefined code paths that you wrote. In an agent, the model does — it decides its own steps and tool use dynamically, in a loop, until it judges the task done. Everything else follows from that one difference.
Workflows: predictable by design
A workflow composes LLM calls along a path you defined — chain, route, parallelize, orchestrate. Because you own the control flow, the system is legible: you know what will run, in what order, and roughly what it will cost.
- Pros — predictable cost and latency, easy to test and evaluate, simple to debug, and reliable enough to put in front of customers.
- Cons — you have to know the steps in advance; genuinely open-ended problems don't fit; adding new cases means adding new paths.
- Best when — the task decomposes into known steps: extraction, classification, summarisation, structured generation, retrieval-augmented answers.
Agents: flexible, but harder to trust
An agent hands the control flow to the model. Given a goal and a set of tools, it plans, acts, observes the result, and decides what to do next — looping until it's satisfied or you cut it off. That flexibility is real power for problems where the path can't be scripted. It's also where the risk lives.
- Pros — handles open-ended tasks, adapts to inputs you didn't anticipate, and can chain many tools without you hardcoding the sequence.
- Cons — non-deterministic, harder to evaluate, latency and cost that vary per run, and failure modes that are difficult to reproduce.
- Best when — the task is genuinely open-ended and the number or order of steps can't be known ahead of time: multi-file code changes, deep research, complex triage.
The risks nobody puts in the demo
Agent demos are seductive because they hide the failure surface. In production, that surface is exactly what you manage:
- Runaway cost & latency — an agent that loops ten times makes ten model calls; a bad plan can 10× your bill and your p95 with no warning.
- Compounding errors — each step builds on the last, so a small early mistake snowballs into a confidently wrong final answer.
- Non-determinism — the same input can take different paths on different runs, which makes evals, regression tests, and support tickets genuinely hard.
- Tool & security exposure — an agent with write access or shell/SQL tools can take real, irreversible actions; every tool is attack surface and needs scoping, validation, and read-only defaults.
- Observability debt — without tracing every step, a misbehaving agent is a black box you can't debug.
An agent is not a more advanced workflow. It's a workflow that traded predictability for autonomy — make sure you actually need what you bought.
How to choose
Start with the simplest thing that works and add autonomy only when the problem forces you to. A useful ladder: a single prompt, then a workflow (chaining, routing, parallelization), then an orchestrator that plans dynamically, and only at the top a fully autonomous agent. Most production value sits on the lower rungs.
- Can you write the steps down? Use a workflow.
- Are the steps unknowable until runtime, but the space is bounded? Use an orchestrator-workers workflow before a free-roaming agent.
- Is the task truly open-ended and worth the operational cost? Use an agent — with a capped iteration count, scoped read-only tools by default, full tracing, and a human-in-the-loop for anything irreversible.
// Not: give the model every tool and let it run.
// But: bound the loop, scope the tools, watch everything.
const result = await runAgent(goal, {
tools: readOnlyTools, // write access is opt-in, per action
maxSteps: 8, // hard cap — no infinite loops
onStep: trace, // every decision is observable
requireApproval: isIrreversible,
});None of this is anti-agent. Agents are the right tool for a real and growing set of problems. It's a plea for honesty about the trade: you adopt an agent to gain flexibility, and you pay for it in predictability, cost variance, and operational effort. Make that trade on purpose — not because "agent" was the word in the room.
Don't reach for the most autonomous system you can build. Reach for the least autonomous one that solves the problem.