Workflow or agent?
Read · 1 of 2
Simple first
An agent decides its own steps, which is powerful and also slower, pricier and harder to predict.
If you already know the steps, write them as a workflow: a fixed chain of model calls (summarise → translate → format). Common shapes: a chain, a router that picks one of several paths, parallel calls that are merged, and a generator + checker pair.
Reach for an agent when the steps genuinely depend on what you find along the way: debugging, research, anything open-ended.
Read this lesson as text
Use the simplest thing that works. Often that isn't an agent.
Simple first
An agent decides its own steps, which is powerful and also slower, pricier and harder to predict.
If you already know the steps, write them as a workflow: a fixed chain of model calls (summarise → translate → format). Common shapes: a chain, a router that picks one of several paths, parallel calls that are merged, and a generator + checker pair.
Reach for an agent when the steps genuinely depend on what you find along the way: debugging, research, anything open-ended.
Pick the design
Task A: Every night, take the day's support tickets,
summarise each in one line, and email the list to the team.
Task B: Given a failing test in a large codebase,
find the cause and propose a fix.Which needs an agent?
- A only
- B only: its steps depend on what it discovers
- Both
Show the answer
B only: its steps depend on what it discovers. A's steps never change: a simple workflow (loop over tickets, summarise, email) is cheaper and more reliable. B can't be planned in advance: which files to read depends on what the last one showed. That's what agents are for.