Handbooks  /  Agents vs Workflows
AI~9 min readComparison
Head to Head

Agents vs workflows: who decides the next step?

WorkflowsvsAgents

Every "AI agent" pitch makes autonomy sound like the goal. It isn't — it's a cost. A workflow's fixed path is cheaper, faster, and easier to trust than an agent's open-ended loop, and most tasks don't actually need what only an agent can provide.

01

The one distinction that decides everything

In a workflow, the control flow — which LLM call happens after which, and with what — is written by you, in code, ahead of time. In an agent, the model itself decides its next action at runtime, in a loop: plan, call a tool, observe the result, decide again, until it judges the task done. The difference isn't capability, it's who's driving.

→ The rule

If you can write down the sequence of steps in advance and have it hold for the vast majority of real cases, that's a workflow. If the right next step genuinely depends on what's discovered along the way and can't be known ahead of time, that's an agent.

02

Head to head

DimensionWorkflowsAgents
Control flowFixed by your codeDecided by the model, at runtime
PredictabilityHigh — deterministic pathsLower — harder to test exhaustively
Cost & latencyBounded — known number of LLM callsVariable — can loop many times, unpredictably
DebuggabilityEasy — trace step X did YHarder — must inspect a whole trajectory
Failure modeFails at a known step, has a fallbackCan loop unproductively without guardrails
Engineering overheadLowerHigher — needs sandboxing, step limits, cost caps
Best forWell-defined, repeatable tasksOpen-ended tasks whose path can’t be known upfront
03

When to use each

Reach for workflows

  • The task is well-understood and repeatable
  • Predictability and cost control matter more than flexibility
  • You can enumerate the paths the task will take
  • Debuggability and easy fallback handling matter

Reach for agents

  • The next step genuinely depends on what’s discovered
  • The task space is open-ended (research, debugging an unknown issue)
  • Hardcoding the path would require anticipating every case
  • You’ve confirmed a workflow can’t cover this task’s variability
04

Autonomy is earned, not defaulted to

Start with the simplest workflow that solves the problem. Reach for full agentic autonomy only when the task's unpredictability genuinely requires it — an agent loop costs more in latency, dollars, and reliability risk than a fixed sequence of calls, so that cost needs to buy you something a workflow structurally can't provide, not just feel more impressive to build.

→ The decision rule

Ask: can I write down the steps this task needs, even as a handful of branches? If yes, a workflow will be cheaper, faster, and easier to trust than an agent — build that first.

05

It’s a spectrum, not a binary

"Workflow" and "agent" aren't two discrete categories so much as two ends of a spectrum measured by how much of the control flow you hand to the model. A simple prompt chain (call 1's output feeds call 2, always) is a pure workflow. A router (the model picks one of N predetermined paths, but the path itself is fixed once chosen) hands the model a little control — more agent-like than a chain, but still bounded and enumerable. A full agent loop with an unbounded number of tool calls and no predetermined stopping point sits at the far end, where the model controls not just which path but how many steps it takes and when it's done.

The real engineering decision, then, isn't "workflow or agent" as a one-time architectural choice — it's incrementally deciding, task by task and even sub-task by sub-task, how much of the control flow genuinely needs to be dynamic. Most production systems that call themselves "agents" are actually a workflow with one or two genuinely agentic components embedded in it, not autonomy end to end.

→ The trade you’re actually making

Every increment of autonomy you hand the model buys flexibility and costs predictability — the right amount is exactly as much as the task's real variability demands, no more.

06

A worked scenario: a support-ticket system

Triaging an incoming support ticket — classify it, route it to one of five fixed handlers (billing, bug report, feature request, account access, other) — is a workflow: the five categories are known in advance, the routing logic is stable, and hardcoding "if billing, go here" is both cheaper and more reliable than letting a model improvise a route it might get wrong in a way that's hard to catch. This handles the large majority of incoming tickets cheaply and predictably.

But "investigate this obscure production bug using logs, code search, and running tests to reproduce it" cannot be hardcoded into a fixed path, because you genuinely don't know what the investigation will find — the next useful action (check this log, grep for that error, run this specific test) depends entirely on what the previous action turned up. That's an agent loop, deliberately reserved for the minority of tickets that actually need open-ended investigation, while the cheap, predictable workflow handles routing for the other 90%.

→ The pattern generalizes

Most real systems are a workflow with an agent embedded at exactly the one point where the path genuinely can't be predetermined — not an agent end to end.

Frequently asked

Quick answers

Agent or workflow — which should I use?

Default to a workflow: fixed code paths are cheaper, faster, and easier to debug. Reach for an agent only when the task’s next step genuinely can’t be known in advance and depends on what’s discovered along the way.

Is an agent just a more advanced workflow?

Not quite — it’s a different control-flow model. A workflow’s path is fixed by your code; an agent’s path is decided by the model at runtime. Think of them as two ends of a spectrum measured by how much control flow you hand to the model, not a strict hierarchy.

Why not just always use an agent for flexibility?

Agent loops cost more in latency and dollars (unbounded LLM calls), are harder to test exhaustively, and can fail by looping unproductively. That cost only pays off when a workflow genuinely can’t cover the task’s real variability — using an agent by default pays that cost for no benefit on predictable tasks.

Can a system mix workflows and agents?

Yes, and most production systems do — a fixed workflow handles the well-understood majority of a task, with an agent embedded at the specific point where the path genuinely can’t be predetermined, rather than either extreme applied end to end.

Agents vs Workflows · Vibe Engines · 2026
Finished this one? 0 / 115 Handbooks done

Explore the topic

See this alongside everything else on the same subject — handbooks, system designs, challenges and tools, in one place.