Tell the two apart first
- Workflow: the path is fixed in code; the model completes one clear task at each step
- Agent: the model decides its own route, picks tools and judges when to stop
Workflows are predictable and easy to debug; agents are flexible, but have higher latency, higher cost and compounding errors. For most business scenarios a workflow is enough to start with.
When one script is enough
If a task meets the following three conditions, do not reach for an agent yet:
- The steps are fixed
- The input and output of every step can be stated clearly
- When something goes wrong, you can see at a glance which step caused it
For example, “turn the quotes in a spreadsheet into a page” or “file meeting notes according to a template” can be done with a fixed process plus one model call.
Five reusable workflows
1. Prompt Chaining: split the task into fixed steps, where the output of one step is the input of the next, with checks in between. Suitable for tasks that can be divided into stages, such as “write an outline, check it, then write the body”.
2. Routing: first judge which category the input belongs to, then hand it to the corresponding specialised process. Suitable for classifying support questions and choosing different models by difficulty.
3. Parallelization: split the task into independent subtasks that run at the same time, or run the same task several times and take the consensus. Suitable for having one model produce content while another performs a risk check.
4. Orchestrator-Workers: a main model splits the task, assigns it to submodels and aggregates the results, with subtasks not fixed in advance. Suitable for code tasks that touch multiple files and for research across sources.
5. Evaluator-Optimizer: one model produces output, another picks out problems against criteria, and the loop improves it. Suitable for polishing translations and for writing that needs several rounds of refinement.
What agents are good for
Only when the steps cannot be fixed in advance and you need to adjust based on environmental feedback as you go is an agent worth it, for example:
- Locating and fixing a problem in an unfamiliar project
- Gathering information across several systems and reaching a conclusion
- Operating a software interface to complete a series of tasks
What these tasks have in common: the path is uncertain, multiple attempts are needed, and each round’s result determines the next step.
The cost of complexity
- Latency: every extra round adds time
- Cost: rounds, tool calls and context all accumulate
- Error accumulation: a misunderstanding early on carries through to the end
- Harder debugging: the path is not fixed, so reproducing a problem depends on records
So adding complexity needs a reason: add it only when you have confirmed the simple approach is not enough.
Three principles for building agents
- Simple: if one call solves it, do not use a loop
- Transparent: show the plan, tool calls and intermediate results so they can be checked
- Clear tools: write each tool’s description, parameters and boundaries clearly; if a person cannot tell which tool to use when, the model is even less likely to judge correctly
Checklist
- Written down the task’s fixed steps first and confirmed whether a workflow can do it
- Clarified which steps must be model judgement and which can be hard-coded
- Tool descriptions clear enough for a newcomer to follow
- Intermediate results recorded so every step can be reviewed
- Stop conditions set (max rounds, timeout, budget)
- Tried in a sandbox or small scope before putting it into the real process
Reference: methods adapted from Anthropic’s engineering blog post “Building Effective Agents”, rewritten for practical use.
Questions
What is the difference between a workflow and an agent?
A workflow has a fixed path written in code: what is called first, what comes next, and the model only works inside each step. An agent decides for itself what to do next, which tool to use and when to stop. The former is controllable, the latter is flexible.
What tasks are suitable for an agent straight away?
Tasks whose steps cannot be fixed in advance and that need you to look at results as you go, such as finding and fixing a problem in an unfamiliar codebase, or gathering material across several sources. For fixed-step tasks, a workflow is cheaper and more stable.
Should I use a framework from the start?
Not necessarily. Many patterns can be implemented in a few dozen lines of code calling the API directly; a framework's abstraction layer hides the prompts and returned results, making problems harder to debug. Get the process working first, then decide whether to adopt a framework.