The short answer
An AI workflow runs language models and tools through steps your code defines: first classify, then retrieve, then answer. An AI agent decides its own steps, choosing tools in a loop until the goal is met. Anthropic’s guidance is to find the simplest solution that works and add agentic behavior only when simpler designs fall short. Workflows are cheaper, faster and more predictable; agents are better for open-ended tasks where the steps cannot be known in advance.
Key points
- Workflow: your code sets the path. Agent: the model sets the path.
- Most business tasks fit a workflow.
- Agents suit open-ended problems with unpredictable steps.
- Agents cost more and errors can compound across steps.
- Start with the simplest design, and measure before adding autonomy.
The difference
In "Building effective agents", Anthropic defines workflows as systems where models and tools are orchestrated through predefined code paths, and agents as systems where the model dynamically directs its own process and tool use. Both are useful. The question is how much freedom the task needs.
Five workflow patterns
| Pattern | How it works | Example |
|---|---|---|
| Prompt chaining | Each step’s output feeds the next | Draft, then check, then translate |
| Routing | Classify the input, send it to a specialized path | Billing questions to one prompt, technical to another |
| Parallelization | Run pieces at once, or the same task several times and compare | Check a document against several policies at once |
| Orchestrator-workers | A model splits the task and hands out parts | Change several files for one feature |
| Evaluator-optimizer | One model writes, another reviews, repeat | Improve a translation until it passes review |
Which to build
| Task | Better fit |
|---|---|
| Same steps every time: extract, check, file | Workflow |
| Answer questions from your documents | Workflow |
| Sort and route incoming requests | Workflow |
| Research a question across unknown sources | Agent |
| Resolve a support case that may need several systems | Agent, with limits |
| Fix a bug in a large codebase | Agent |
Workflows are easier to test, cost less per run and fail in predictable places. Agents adapt, but take more steps, use more tokens and can compound a mistake. Many products combine them: a workflow with one step where a small agent handles the unpredictable part.
Starting simple
- Try a single well-written model call with the right context.
- If that is not enough, break the task into a workflow.
- Only then give the model freedom to choose steps, with limits on tools, steps and spending.
- Measure each version against the same test cases. See How to evaluate AI agents.
For the agent side, see How to build an AI agent and Multi-agent systems. Both workflows and agents are built in AI agent development.
Sources
Checked when this guide was written.