AI agent vs AI workflow: which one do you need

Most things sold as agents are workflows with a chat box. That is usually the right choice, and pretending otherwise costs money.

Carlo Zuercher
Carlo Zuercher
Staff Engineer, Platform
9 August 20261 min read

The difference in ai agent vs ai workflow is one thing: who decides what happens next. In a workflow, you do, at build time. In an agent, the model does, at run time. Everything else people cite as the distinction, tool use, memory, multi-step behaviour, appears in both.

That single line resolves most of the confusion, and it also tells you which to pick. If you can write down the steps, write them down. Handing step selection to a model is a real cost you should only pay when the steps genuinely cannot be known in advance.

What each one looks like

A workflow is code with model calls in it. Fetch the ticket, classify it, if it is a refund request pull the order, draft a reply, send it for approval. The model does the parts that need language understanding. The control flow is yours, written in an ordinary programming language, and it runs the same way every time.

An agent is a loop. The model gets a goal and a set of tools, picks a tool, sees the result, and decides again. It might use three tools or thirty. It might take a route you never considered, which is the point, and also the risk.

Both call models. Both use tools. Both can run for a long time. The difference is whether the sequence is a property of your code or an output of the model.

AI agent vs AI workflow, side by side

Dimension

Workflow

Agent

Who picks the next step

You, at build time

The model, at run time

Cost per run

Predictable, roughly fixed

Variable, occasionally alarming

Latency

Known, often parallelisable

Unknown until it stops

Debugging a failure

Reproduce it, read the code path

Reproduce it if you are lucky

Handles unforeseen input

Falls over or falls through

Adapts, sometimes correctly

Testing

Ordinary integration tests

Statistical, over many runs

Blast radius

Bounded by the code

Bounded by the tools you granted

The cost row understates it. A workflow with six model calls costs the price of six model calls. An agent solving the same problem might do it in four and might do it in forty, and the forty case is often the one where it also failed. Variance, not the average, is what makes agent budgets hard, and it is why a hard ceiling is not optional. We covered the mechanics in how to set spending limits for AI agents.

When the workflow wins

Almost always, for anything that runs in production against real customers. Specifically:

  • The task has a known shape. Invoice processing, ticket triage, content moderation, data extraction. You know the steps because you have done them by hand.

  • You need the same input to produce the same output. Regulated work, financial calculations, anything a customer will compare across two runs.

  • Cost has to be predictable. Per-unit economics you can quote to a customer require per-unit costs you can predict.

  • Failures need to be explainable. A workflow can tell you which step failed. An agent can tell you what it thought at the time, which is not the same thing.

  • The work is high volume and low value per run. Agent overhead does not amortise well over a job worth two cents.

The uncomfortable version of this: most production AI systems that describe themselves as agentic are workflows, and they are better for it. Chat is a user interface, not an architecture.

When the agent earns it

There is a genuine class of problems where the workflow cannot be written, because the branch you would need to write depends on something you only learn during the run.

Coding is the clearest case. You cannot write down the steps to fix a bug, because the third step depends on what the first two revealed. Research is another: what you search next depends on what you just read. Debugging, exploration, and anything where the state space is too large to enumerate and the cost of a wrong path is just a retry.

Notice the shared property. In each case the model is doing something a competent human would also do by improvising, and a wrong turn is cheap. When a wrong turn is expensive, the case for the agent weakens sharply regardless of how open-ended the task looks.

The middle ground most teams should be in

The framing is not binary, and treating it as binary is how teams end up with an agent they cannot debug. Anthropic's engineering write-up on building effective agents makes the same argument from the other direction: find the simplest thing that works, and add agentic behaviour only where it demonstrably helps.

In practice the shape that works is a workflow with one agentic step. The outer loop is code: fetch, validate, route, record, notify. One box in the middle is an agent, given a narrow goal, a small tool set and a step cap. The workflow decides when to invoke it and what to do if it fails or times out.

You get adaptability where the problem needs it, and determinism everywhere else. It is also far easier to sell, because you can describe what the system does.

Migrating from one to the other

If you built an agent and it is unreliable, the fix is usually not a better prompt. Log the tool call sequences from a few hundred real runs and read them. In most systems a small number of paths cover the overwhelming majority of runs. Those paths are your workflow. Write them as code, keep the agent as the fallback for the tail, and cost, latency and failure rate all improve at once. This is also the cheapest way to find out that the agent has been solving a narrower problem than you thought.

Going the other way is rarer and usually a mistake. Teams reach for an agent when a workflow has too many branches, but a workflow with too many branches is a sign the problem is under-specified, not that the model should be choosing. The exception is when the branches depend on external systems you do not control, which is genuinely agent territory.

Either way, an agent that touches anything outside your own codebase needs bounding first. How to sandbox an AI agent covers the controls that matter before you let one loose.

FAQ

Is a chatbot an agent?

Not by itself. A chatbot that only answers is neither. It becomes an agent when it can choose and use tools to affect the world. AI chatbot vs AI agent goes through the distinction.

Are agentic workflows a third category?

The term usually means a workflow containing one or more model-driven steps, which is the middle ground above. It is a useful pattern and an unhelpfully vague label.

Which is cheaper to run?

Workflows, almost always, and more importantly their cost is predictable. Agents can be cheaper on tasks where they find a short path, but you cannot budget on that.

Can I start with an agent and tighten it later?

Yes, and it is a reasonable prototyping strategy. Use it to discover the paths, then encode the common ones. Just do not ship the prototype and call the variance a feature.

How did this land?

About the author

Carlo Zuercher
Carlo Zuercher

Staff Engineer, Platform

Carlo works on the platform that turns prompts into running apps. He writes the engineering deep dives and the changelog notes worth reading.

Share

Get the next post in your inbox

One email a month. Product updates, engineering posts, and the best of Built with Swarmz.

I agree to receive emails about AI building tips and Swarmz product news. Unsubscribe any time.