Skip to content

Chain or workflow

A chain or workflow follows code paths defined before the request runs. A model may perform individual steps, but application code decides their order and branches.

invoice → extract fields → validate total → request approval → write to ERP

The model may extract the fields. Code still chooses the next step and blocks the write when validation or approval fails.

Workflow Agent
Code chooses the path Model chooses the next action
Predictable call count Variable call count
Easier to test More flexible for open-ended work
Best when steps are known Best when findings determine the next step

Anthropic uses this same architecture distinction and recommends adding agentic complexity only when the task needs it.1

A workflow can contain one bounded agentic node. Keep known policy, validation, authorization, and side effects deterministic around it.

  1. Anthropic, “Building effective agents”.