# Agent vs workflow

A workflow runs steps you fixed in advance. An agent lets the model choose the next step at runtime.

AI developers · Part 04: Agents · Card 4 of 11 · Last updated 2026-10-13

## Analogy

A workflow is a hard-coded Express route. An agent is a teammate with a ticket: more flexible, less predictable, and they bill by the hour.

## In an agent

Workflows are cheaper, faster and easier to test. Agents handle open-ended tasks where the path depends on what is found.

## Practice

### Flashcards

- **Interview: agent or workflow, which do you default to?** A workflow: cheaper and predictable. Use an agent when the path depends on what is found.

### Interview questions

**Agent vs workflow?**

- A workflow runs steps you designed in advance, in a fixed order.
- An agent lets the model choose the next step in a loop, until the goal is met.
- Workflows are cheaper, faster and easier to test; agents handle open-ended tasks.
- Default to a workflow; use an agent when the path depends on what is found.

## Questions people ask

### When should I use a workflow instead of an agent?

Use a workflow when you can write the steps down in advance, like extract an invoice, check it, then save it. Workflows are cheaper, faster and easier to test. Use an agent when the next step depends on what the last step found and you cannot draw the path ahead of time.

### Are agents better than workflows?

Not better, different. Agents are more flexible but less predictable, slower and more expensive, because the model decides at runtime. Workflows are reliable and cheap but only follow the paths you wrote. Many good systems are mostly workflow, with a small agent only where the task is truly open-ended.

## Related concepts

- [Use the simplest thing that works](https://studyvisually.com/learn/tech/ai-developers/agents/simplest-thing)
- [Who decides the next step](https://studyvisually.com/learn/tech/ai-developers/llm-basics/ai-levels)
- [Agent](https://studyvisually.com/learn/tech/ai-developers/agents/agent)
- [The agent loop](https://studyvisually.com/learn/tech/ai-developers/agents/agent-loop)

Web page: https://studyvisually.com/learn/tech/ai-developers/agents/agent-vs-workflow
Study this card in the app: https://studyvisually.com/app/learn?category=ai-developers&card=agent-vs-workflow
