Skip to content
Agent Builder
Module 1Full course9 min read

Agents vs. Workflows: When to Use Which

Not everything should be an agent. Learn the spectrum from single prompts to chains to autonomous agents and how to choose.

Once you've seen what agents can do, it's tempting to make everything an agent. Resist that. Many of the most reliable AI systems in production aren't agents at all. They're a few well-placed model calls wired together with ordinary code, and they're cheaper, faster, and far easier to debug than an agent doing the same job.

The real skill isn't building agents; it's knowing how much autonomy a task actually needs. In this lesson you'll learn the spectrum from a single prompt to a fully autonomous agent, the common patterns in between, the trade-offs at each step, and a short set of questions that tell you where any task belongs. You'll also see a small, runnable example of a workflow, so you can feel the difference between code deciding the steps and the model deciding them.

Workflows vs. agents: who decides the next step?

Both workflows and agents use language models. The difference is who controls the sequence of steps.

  • In a workflow, your code decides the steps. The model is called at fixed points, for example "summarize this", then "classify that", but the path through the system is written in advance by you.
  • In an agent, the model decides the steps. It's given a goal and some tools, and it chooses what to do next, how many steps to take, and when it's finished, using the loop from The Agent Loop.

Anthropic's widely cited engineering guide, "Building effective agents" (December 2024), draws the line in the same place, and makes the same core recommendation this lesson does: find the simplest solution that works, and add autonomy only when it clearly improves results.

WorkflowAgent
Who decides the stepsYour codeThe model
Number of model callsFixed or boundedVaries by task
PredictabilityHighLower
Cost and latencyLower, and easy to estimateHigher, and varies run to run
DebuggingInspect each fixed stepRead through a trace of decisions
Handles surprisesOnly the ones you planned forCan adapt to new situations