AI Agents

Agents vs. workflows: when to let the model decide

Not every AI feature needs an autonomous agent. A simple way to choose between a fixed workflow and an agent — and how to mix them.

Key takeaways

  1. 01Use a workflow when you can draw the steps; an agent when you can't.
  2. 02Route the predictable 80% to code and the rest to a small agent.
  3. 03Cap steps and spend, log tool calls and escalate when unsure.
  • #agents
  • #architecture
  • #LLM

'Agent' has become the default word for any AI feature. But many problems are better solved by a workflow: a fixed sequence of steps where the model fills in specific parts. Choosing correctly saves cost, latency and a lot of debugging.

Use a workflow when the path is known

If you can draw the steps on a whiteboard — classify the email, extract fields, draft a reply, send for approval — write them as code. The model does narrow tasks inside a predictable pipeline that is easy to test.

Use an agent when the path depends on what it finds

Research, troubleshooting and multi-system tasks often can't be scripted ahead of time. An agent loop — think, call a tool, observe, repeat — lets the model choose the next step based on results.

The hybrid that works best

  1. Start with a workflow for the 80% of cases that are predictable.
  2. Route the unusual cases to an agent with a small, well-described toolset.
  3. Cap the agent's steps and spend, and log every tool call.
  4. Escalate to a human when the agent is unsure or a step is irreversible.