AI comparison
AI agent vs workflow
A workflow runs steps you wrote in advance, using a model at some of them; an agent lets the model choose the steps, which is more flexible and harder to predict.
| Aspect | Agent | Workflow |
|---|---|---|
| Who chooses the next step | The model | Your code |
| Predictability | Lower; paths vary between runs | High; the same steps each time |
| Testing | Harder; judge the trajectory and end state | Easier; test each step |
| Cost | Varies with how many steps it takes | Known in advance |
Choose Agent when
- The steps depend on what is found along the way
- The task is open-ended, such as investigating a bug
- You can bound it with limits on steps, spend and tools
Choose Workflow when
- You can write the steps down
- Reliability and cost matter more than flexibility
- Each step must be checked or approved
Learn it hands-on
These free lessons teach it with commands to run in a lab and checked tasks. Read them whole with no account.
Related terms
- AI agent
- An AI agent is a program in which a language model chooses its own next step, calling tools in a loop until the task is done or it is stopped.
- Agent loop
- The agent loop is the cycle at the heart of an agent: send the conversation to the model, run any tool it asks for, add the result, and repeat.
- Multi-agent system
- A multi-agent system splits a task between several AI agents, each with its own role, tools and context, coordinated by code or by another agent.