Skip to main content

What is the difference between an agent and a workflow?

Agents and tools · Intermediate 3

Short answer

A workflow runs model calls and tools along steps fixed in code, so its path is predictable. An agent lets the model decide its own next step in a loop: think, call a tool, observe the result, repeat until done. Agents handle open-ended tasks but are harder to predict, test and keep cheap.

Deeper answer

Anthropic's widely cited write-up draws this line and recommends the simplest thing that works: a single well-prompted call, then a workflow such as prompt chaining, routing or evaluator-optimizer, and only then an agent. Many "agents" in production are really workflows with a few model decisions, which is often the right call.

A good answer names the trade-off: agents add flexibility at the cost of latency, cost, debugging effort and risk. Use them when the steps cannot be known in advance, and add guardrails: step limits, tool permissions, logging and human approval for risky actions.

What a strong answer covers

Answer it out loud in the mock interview about 1 min

Follow-ups to expect

Common mistakes

Learn it

The agent loop

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.