Agentic workflow (workflow vs agent)
A process where your code fixes the steps and a model does some of them, as opposed to an agent that decides its own steps.
An agentic workflow is a process where your code fixes the steps and a language model does some of them. An AI agent is the opposite: the model decides its own steps. Most production systems are workflows with an agent inside one or two of the steps.
Anthropic’s Building effective agents (December 2024) names five common workflow shapes. Prompt chaining runs fixed steps in sequence with checks between them. Routing classifies the input and sends it to a specialized prompt or model, see model routing. Parallelization runs independent subtasks at once, or the same task several times with a vote, and merges the results (fan-out and fan-in). In orchestrator-workers a model splits the task at run time and hands parts to workers. In evaluator-optimizer one model drafts and another critiques until the draft passes. The table compares them with a full agent.
A workflow is predictable, testable and cheaper, because each step can be checked with evals on its own. An agent handles tasks whose steps cannot be known in advance, at the price of variable cost and harder testing. A common mistake is starting with a multi-agent system when a chain of two prompts would do.
| Pattern | What happens | Use it when | Cost |
|---|---|---|---|
| Prompt chaining | Fixed steps, each uses the previous output | Task splits into known steps | Low, more latency |
| Routing | Classify input, send to a specialized path | Input types need different handling | Low, one extra call |
| Parallelization (fan-out) | Independent parts or votes run at once | Parts are independent, or you want votes | Tokens times branches, but faster |
| Orchestrator-workers | A model splits the work at run time | Subtasks unknown until you start | Medium to high, varies per task |
| Evaluator-optimizer | Draft, critique, revise until it passes | Clear criteria, revision measurably helps | Several rounds per output |
| Agent | The model picks every next step | Open-ended task, unpredictable steps | Highest and least predictable |
Sources
- Anthropic: Building effective AI agents anthropic.com
Related terms
- AI agent: A model that decides its next step itself, calls tools and repeats until the task is done.
- Orchestrator-workers pattern (supervisor): One model plans the task, hands parts of it to worker models or subagents, and combines their results.
- Multi-agent system (multi-agent orchestration): Several AI agents with separate roles and contexts working on one task, usually coordinated by a lead agent or a fixed workflow.
- Prompt chaining: A fixed sequence of model calls where each step works on the previous step’s output, with checks in code between the steps.
- Fan-out and fan-in (parallelization): Splitting work into parallel model calls or subagents (fan-out) and merging their results in one step (fan-in).
- Evaluator-optimizer (maker-checker): One model drafts, another checks the draft against stated criteria and returns feedback, in a loop until it passes or a round limit stops it.
- Model routing and fallback: Sending each request to the model that fits it, and to another one when the first fails.
- Agent graph (state graph): Modeling an agent as explicit nodes, edges and shared state, with checkpoints, so each step can be paused, resumed, inspected and tested.
- Blueprint (deterministic and agentic steps): A workflow defined in code that mixes fixed steps, such as lint, build and git, with steps where an agent decides what to do.
