Agents and Workflows: Tell Them Apart Before You Build
The most common interview follow-up: "Why does your use case need an agent? Wouldn't a fixed flow work?"
Core concepts
The distinction drawn in Anthropic's Building effective agents:
| Workflow | Agent | |
|---|---|---|
| Control flow | LLMs and tools orchestrated through paths predefined in code | The model decides what to do next and which tool to call |
| Strengths | Predictable, testable, controllable cost | Flexible; handles open-ended tasks without fixed steps |
| Weaknesses | Fails on anything unanticipated | Higher cost and latency, errors compound, hard to debug |
| Good for | Business processes with clear steps (most B2B scenarios) | Tasks whose steps can't be enumerated in advance (debugging, browser automation) |
The article's core advice: start with the simplest solution and add complexity only when it is truly needed. Many use cases don't need an agent at all.
How it works: five common workflow patterns + agents
| Pattern | How | Example |
|---|---|---|
| Prompt chaining | Each step's output is the next step's input, with programmatic checks in between | Extract → validate → generate report |
| Routing | Classify first, then hand off to a specialized prompt / model | Route by document type into contract / invoice / customs-declaration flows |
| Parallelization | Split into independent subtasks run in parallel, or vote across multiple runs | Check several review rules in parallel |
| Orchestrator-workers | A central LLM dynamically breaks down the task, delegates and aggregates | Research tasks where it's unclear which sources are needed |
| Evaluator-optimizer | One generates, one reviews, iterating in a loop | Translation, polishing copy |
| Agent | The model uses tools autonomously in a loop until done or a stop condition is hit | Browser automation, code fixing |
ReAct
ReAct (Yao et al., 2022) alternates "reasoning" and "acting": think → call a tool → observe the result → think again. Today's native tool calling loop is essentially an engineered implementation of ReAct.
In practice: choosing an approach for a requirement
Can the steps of the requirement be listed in advance?
├─ Yes → Workflow (chaining / routing / parallel); any step can use an LLM
│ └─ One step needs flexible exploration inside it? → embed a constrained small agent in just that step (limited tools + max steps)
└─ No → Agent
└─ Must have: max steps, a tool allowlist, human confirmation for dangerous actions, a full trajectory logCommon pitfalls
- Using an agent "because it looks advanced": using an agent where a fixed flow would do makes things slower, more expensive and less stable.
- Starting with a heavy framework: first write the loop clearly against the API, then decide whether to bring in a framework once you understand it. A framework's abstraction layers can hide the real prompts and responses and make debugging harder (a warning also given in the Anthropic article).
- Agents with no stop condition and no trajectory logging: when something goes wrong you can't reproduce it.
Common interview questions
- What's the difference between a workflow and an agent? Why did your project choose what it did?
- Name a few workflow patterns with examples.
- What's the difference between orchestrator-workers and parallelization? (Whether the subtasks are determined in advance)
- What is ReAct? How does it relate to today's tool calling?
- How do you control an agent's cost and reliability?
How it relates to my projects
- AI Document Review Pipeline: mainly a workflow (chaining + routing + parallelization).
- Browser Automation Agent: the steps aren't fixed, so it suits an agent. The two projects make a good contrast.
Sources
- Anthropic Engineering: Building effective agents (2024-12) — definitions of workflows and agents, the five patterns, the "start simple" advice
- Yao et al., 2022 · ReAct: Synergizing Reasoning and Acting in Language Models (arXiv 2210.03629)
