Chapter 4: Workflows vs Agents
Lecture
Chapter principle
Key takeaways
- A workflow substantially predetermines the control path; an agent delegates meaningful runtime control decisions.
- Runtime discretion buys adaptability but adds cost, latency, variance, and failure trajectories.
- Simple stable conditions should usually remain deterministic.
- Hybrids concentrate model reasoning where semantic uncertainty actually exists.
- Use the least autonomy necessary for the task.
Experiments
Every experiment in the book is small, runnable and printed with its real output. In the Lab you can replay a recorded real run of each one, with no programming, and watch what the model and the agent do.
Experiment 7: Workflow vs agent
When should the programmer fix the path, and when should the model choose it?
The same job built twice: turn a report into an English summary line. The workflow follows steps the programmer wrote: fetch, translate if the language field is not English, format. The agent gets the same three tools, and a real model chooses each step. Both handle an English report, a French one, and a Spanish one whose language field wrongly says English. Translation is a model call in both. This is a recorded run. Timings vary between runs.
All the code for this chapter: github.com/agentic-engineering-book/code
Download the bookBrowse all chapters