esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
  • Download ResumeContact
Let’s talk

I’ll build the agent for it.

Workflow vs Agent?

Workflows versus agents: who picks the next step, when each one fits, and why to start simple, explained for your AI interview.

In short

A workflow runs fixed steps in an order your code writes down. An agent lets the model choose its own next step and tools until the task is done. Start with the simplest option that works, and add agent freedom only when the task needs it.

10 min readIntermediateVery common · estimateFacts checked 26 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

A workflow runs fixed steps in an order my code sets. With an agent, the model picks its next step and tool, reads the result, and loops until the job is done. Anthropic's advice is to start with the simplest option, often one model call, and move to an agent only when the steps can't be known in advance. Agents cost more and can compound errors, so they need stopping rules and testing.

What is the difference, in plain words?

A workflow is a set of steps that a developer writes in code. A model may handle one of the steps, such as summarising an email, but the code decides what runs next.

An agent hands that decision to the model. It chooses its next step and its next tool, reads the result, and chooses again, until it has an answer or hits a limit.

Anthropic's December 2024 article groups both kinds under agentic systems, then draws the line at who decides the path.

Picture a bank's loan desk. A new clerk works from a checklist: verify ID, check the limit, draft the letter. A senior credit analyst decides her next check based on what she finds. The checklist is the workflow and the analyst is the agent. Both have a place. The job decides how much freedom to give.

Key words

Workflow
Steps linked in code. A model can fill a step, but your code picks the next one.
Agent
A model that picks its own steps and tools, in a loop, until the task is done.
Tool
Something your code runs for the model, like a file read, a database lookup or an email send.
Stopping rule
A limit, such as a maximum number of steps, that ends a run before it goes on forever.

How do the two differ in practice?

  • Workflow

    Your code picks the path

    Steps and their order are written in advance. Easy to test, predictable in cost, and right for a job with known parts.

  • Agent

    The model picks the path

    Steps and tools are chosen as it runs. Fits open-ended jobs, but costs more and mistakes can pile up.

  • “Workflows are systems where LLMs and tools are orchestrated through predefined code paths.”

    Anthropic, on workflows

  • “Agents, on the other hand, are systems where LLMs dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks.”

    Anthropic, on agents

Take a motor insurer's claims desk. It gets about 4,000 claims a month. Most are routine, so a workflow handles them in a fixed order: read the form, check the policy is active, pay small claims that match a template, and send the rest to an adjuster. The monthly cost is easy to predict.

Who picks the next step?

A task arrives

a claim or a failing build

Workflow

Fixed steps in code

same order every time

Agent

Model picks each tool

order changes with the input

Easy to test

cost is easy to predict

Flexible, harder to test

mistakes can compound

  1. 1On the workflow path, the work follows steps your code set in advance.
  2. 2On the agent path, the model chooses each tool as it goes.
  3. 3The fixed steps finish, and the result is easy to predict and test.
  4. 4An agent may take a different route each time, so it is harder to test.
Both paths start from the same task. In a workflow, your code sends the work down steps written in advance. In an agent, the model chooses each step, so the route can differ each time.

What does an agent loop look like?

An agent is usually a loop. The Claude Agent SDK docs (a library for building production AI agents) put it this way: "Claude continues calling tools and processing results until it produces a response with no tool calls." The model asks, your code acts, and the result goes back.

The agent loop

Your task

with the rules and the tool list

Model

plans the next step

Your code runs a tool

reads a file or runs a test

Done

no more tool calls

  1. 1Your task goes in, with the rules and the list of tools.
  2. 2The model picks one tool and asks for it.
  3. 3Your code runs the tool and sends the result back to the model.
  4. 4When it needs no more tools, the model stops and answers.
The model and your code take turns: the model asks for a tool, your code runs it and returns the result, and the model decides again. The loop ends when no tool is needed. Because a model can keep asking for tools, an agent needs a stopping rule, such as a maximum number of steps.

Your code runs the tools you define, so it is the place to check each call before it runs. Anthropic's guide says it is common to add stopping conditions, such as a maximum number of loops, to keep control. Agents can also pause for a person at checkpoints or when they hit a blocker.

Which one should you build?

Anthropic's rule is to find the simplest solution and add complexity only when needed. In practice that gives this order. Go down it and stop at the first step that solves the job.

  1. 1

    One model call

    Give the model the right documents first (retrieval, which means looking up the facts it needs) and a few examples. Anthropic says that is usually enough for many applications.

  2. 2

    A workflow

    Write the steps in code when the job splits into fixed parts, like the claims desk.

  3. 3

    An agent

    Use one when the steps can't be known in advance. Keep a person in the loop for risky actions.

  • “we recommend finding the simplest solution possible, and only increasing complexity when needed.”

    Anthropic

  • “The autonomous nature of agents means higher costs, and the potential for compounding errors.”

    Anthropic

Agents suit open-ended problems. Anthropic describes them as fitting work where it's difficult or impossible to predict the required number of steps.

Tip

Name the source and its date when you quote it, and say which parts of the advice are about the idea and which are about a tool that may change.

What does the interviewer want to hear?

A strong answer covers

  • A plain split: in a workflow your code picks the path, in an agent the model does.
  • One real example of each, from a team's work.
  • Why start simple: cost, speed and easier testing.
  • Agents need stopping rules, step limits and tests on a safe copy of the system.
  • A person's check before risky actions.
  • The honest trade-off: agent flexibility costs predictability.

Common traps

  • Trap"Agents are just chatbots with better models."

    BetterAn agent runs a loop: it picks tools, reads results and decides when it is done.

  • Trap"Always build an agent, it is the smarter choice."

    BetterAgents cost more and can compound errors. Start simple and add freedom only when the job needs it.

  • Trap"A workflow doesn't use AI at all."

    BetterWorkflows call models too. The difference is who decides the order: your code or the model.

Can you spot the agent?

Spot the agent

Which of these four systems lets the model choose its own next step?

Quick check

A bank's loan letter generator always runs the same five steps: read the form, check the credit file, draft the letter, check the tone, send it for approval. What is it?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q157What is an AI agent?11 min
  2. Q159Name the five common workflow patterns.10 min
  3. Q160What is the agent loop?12 min
  4. Q161What is ReAct for agents?12 min
  5. Q162How do agents plan?10 min

Learn it in depth

Last updated on 26 November 2026

Building an AI workflow or an agent for your team?

I design and build AI products and agents: the interface and the system behind it. Book a short call and tell me what the job needs to do, and we can talk through whether it needs a workflow or an agent.