Lab

Workflow graph

Workflow graph: A fixed map of steps written in ordinary software, where code chooses which step runs next and a model fills in only some of the steps.

In an agent loop, the model’s output picks the next step: it outputs a tool call, and that call is what runs. A workflow graph turns this around. The steps and the arrows between them are written down in ordinary software ahead of time, and the code follows the arrows.

A simple example: fetch the document, then ask a model to summarise it, then check the summary against a rule, then either send it on or go back one step. The model is used inside some of the boxes, but it does not choose which box comes next. The graph does.

Anthropic’s guide to building agents draws the same line. It calls systems where models and tools are orchestrated through predefined code paths “workflows”, and keeps “agents” for systems where the model directs its own process and tool use.

Neither is better in general. A graph is easier to test, cheaper to run and harder to lead astray, because a step that is not on the map cannot happen. An open agent loop copes better with tasks whose steps cannot be known in advance. Many real systems mix the two: a graph with a small agent loop inside one of its boxes, or an agent whose tools are themselves small workflows.

“Graph engineering” is an informal name some people now use for designing these maps.

The explainer runs the same task both ways so you can compare the steps and the cost.

See it working

Explore it in How an AI agent works

Step through a model calling tools in a loop, and see how the harness around it decides what it sees, what it may touch and when it stops.

Open the explainer