Lesson 40.2 · 2 of 3 · 5 min read · Reviewed 24 Nov 2026
When a workflow is enough
By the end, you can
- Choose a workflow over an agent when the steps are known in advance.
- Start with the simplest design and add autonomy only when evals show you need it.
The most common design mistake with agents is using one when a workflowWorkflow: A system where LLM calls and tools follow a path defined in code, rather than chosen by the model. would do.
The test
Before building, try to draw the task as a flowchart. If every box and arrow is known before the input arrives, build a workflow:
- Translate a document, then check the translation: a chain.
- Sort tickets into billing, technical or other, then answer: routingRouting: A workflow pattern that classifies an input and sends it to a specialised prompt, model or handler..
- Review code for security, style and bugs separately: parallel sections.
Use an agentAgent: A system where a model decides its own next steps, calling tools in a loop until the task is done. when you cannot draw it ahead of time: debugging a failing test, researching an open question, or fixing whatever a customer’s account turns out to need. The model has to look, then decide.
Climb the ladder one rung at a time
- One good prompt, with retrieval or examples if needed.
- A workflow of several calls.
- An agent.
Move up only when your evals (Part 3) show the simpler design failing on cases you care about. Each rung adds cost and latencyLatency: The time from sending a request until you get the response, or until the first token arrives when streaming., and makes failures harder to explain.
How it fails
Teams pick an agent because it demos well. In production it takes different paths on similar inputs, costs vary tenfold between runs, and nobody can say why a run went wrong. A workflow would have handled 90% of the traffic.
Key points
- If you can draw the steps as a flowchart before the task starts, use a workflow.
- Agents pay off when the number and order of steps depends on what the model finds.
- Start with one well-prompted call, then a workflow, then an agent, and let evals justify each step up.
Climb the design ladder with evals
Choose the simplest design that meets your quality bar, using eval results instead of instinct.
You will have: A chooser that prints the recommended rung for three projects, with the evidence behind each choice.
Steps
- Read the eval results: pass rates for a single prompt, a workflow and an agent, plus a relative cost for each.
- Write choose(results, target) that walks the ladder from the simplest rung and returns the first one that meets the target on the cases you care about.
- If no rung meets the target, return the best one and say so.
- Print the choice, its pass rate and its relative cost for each project.
- Change one target and see whether the choice moves up a rung.
Done when
- The FAQ project stops at a single prompt.
- The extraction project stops at a workflow, not an agent.
- The debugging project needs the agent, and the output says why.
Open in the Playground No API key needed.
Starter code (Python)
LADDER = ["single prompt", "workflow", "agent"]
projects = {
"faq answers": {"target": 0.90, "pass": [0.93, 0.95, 0.95], "cost": [1, 3, 12]},
"contract extraction":{"target": 0.95, "pass": [0.81, 0.97, 0.97], "cost": [1, 4, 15]},
"debug failing tests":{"target": 0.70, "pass": [0.20, 0.45, 0.78], "cost": [1, 5, 20]},
}
def choose(p):
# TODO: return (rung name, pass rate, cost, reason) for the first rung meeting the target
return LADDER[-1], 0, 0, "TODO"
for name, p in projects.items():
print(name, choose(p))
Show a solution
LADDER = ["single prompt", "workflow", "agent"]
projects = {
"faq answers": {"target": 0.90, "pass": [0.93, 0.95, 0.95], "cost": [1, 3, 12]},
"contract extraction":{"target": 0.95, "pass": [0.81, 0.97, 0.97], "cost": [1, 4, 15]},
"debug failing tests":{"target": 0.70, "pass": [0.20, 0.45, 0.78], "cost": [1, 5, 20]},
}
def choose(p):
for i, rung in enumerate(LADDER):
if p["pass"][i] >= p["target"]:
why = "simplest rung that meets the target" if i == 0 else f"{LADDER[i - 1]} failed at {p['pass'][i - 1]:.0%}"
return rung, p["pass"][i], p["cost"][i], why
best = max(range(len(LADDER)), key=lambda i: p["pass"][i])
return LADDER[best], p["pass"][best], p["cost"][best], "no rung meets the target: rethink the task"
for name, p in projects.items():
rung, rate, cost, why = choose(p)
print(f"{name:<20} -> {rung:<13} pass {rate:.0%}, cost {cost}x ({why})")