# What is an agentic workflow, and how is it different from an AI agent?

A fixed sequence of model calls and tools that your code controls, such as classify, then look up, then draft. An agent decides its own next steps; a workflow follows the path you wrote.

- Page: https://tecyfy.com/concepts/agentic-workflow
- Subject: AI agents (https://tecyfy.com/concepts)
- Level: intermediate
- Also called: AI Workflow, LLM Workflow, Prompt Chaining, Routing, Evaluator-Optimizer

"Agentic" gets used for any system where a language model does more than answer once. It helps to split that into 2 kinds, as Anthropic's engineers do. In a **workflow**, your code decides the steps: the model is called at fixed points, for fixed jobs, and the path is the same every time. In an [Agent](https://tecyfy.com/concepts/agent), the model decides the steps: it chooses which tool to call next, reads the result and keeps going until it judges the task done.

A shop's email handling as a workflow looks like this:

1. A model sorts the email into a category.
2. Code looks up the order, if there is a number.
3. A model drafts a reply from the email and the order.
4. A person sends it.

Each step can be tested on its own, the cost of an email barely varies, and nothing happens that you did not write.

## The common workflow shapes

Anthropic names 5 patterns that cover most workflows:

- **Prompt chaining.** One call's output is the next call's input, with checks in code between them: write an outline, check it, then write the text.
- **Routing.** A first call classifies the input and sends it to the prompt, tool or model that suits it: refunds one way, product questions another, easy questions to a small model.
- **Parallelization.** Split a task into parts that run at once (sectioning), or run the same task several times and compare the answers (voting).
- **Orchestrator-workers.** A model breaks a task into parts it could not know in advance and hands them out, the [planner-executor](https://tecyfy.com/concepts/plannerexecutor-pattern) shape.
- **Evaluator-optimizer.** One call writes, a second judges against criteria, and the first revises until the judge passes it.

## Workflow or agent?

Start with the simplest thing that works, and add steps only when testing shows they help. A workflow fits when you can write the steps down: it is predictable, cheaper and easier to test. An agent fits when you cannot, because the number of steps depends on what each one finds, as in debugging code or researching a question. That freedom costs more tokens and lets mistakes compound, so agents need limits on their steps, tools that cannot do serious harm on their own, and an [eval set](https://tecyfy.com/concepts/eval-set) that checks what they actually did.

Most real systems mix the two: a workflow whose steps include a small agent, or an agent that calls a fixed workflow as one of its tools.

## Related

- [Agent](https://tecyfy.com/concepts/agent): A model that uses tools in a loop, deciding each next step from what the last one returned, until the task is done.
- [ReAct Pattern](https://tecyfy.com/concepts/react-pattern): An agent design where the model alternates between reasoning about what to do next and taking an action, such as a tool call, then reads the result before deciding again. Most agent loops today follow it.
- [Planner-Executor Pattern](https://tecyfy.com/concepts/plannerexecutor-pattern): An agent design that splits the work in 2. A planner writes the whole plan first, and an executor, which can be cheaper code or smaller models, carries out each step. The plan is changed only when a step fails.
- [Orchestration](https://tecyfy.com/concepts/orchestration): Running the steps of data pipelines in the right order and at the right time, retrying failures and alerting someone when a step breaks.
- [Eval Set](https://tecyfy.com/concepts/eval-set): The list of test cases an LLM app is graded on after every change. Each case is an input and what a good answer must do, so a score going up or down shows whether the change helped.

## Sources

- [Building effective agents](https://www.anthropic.com/engineering/building-effective-agents)
