← All resources

Building Agents

State Machines for Agent Workflows

Combining model judgment with explicit workflow states, transitions, and recovery paths.

Make progress explicit

States such as gathering information, awaiting approval, executing, and verifying give the application a durable view of progress. The model helps choose within a state instead of controlling the entire process implicitly.

Guard every transition

A transition should check required data, authorization, and prior results before moving forward. Invalid transitions become visible application errors rather than confusing model behavior.

Recovery becomes manageable

Persisted states let interrupted work resume and failed steps retry safely. Operators can inspect where tasks are stuck without reconstructing a conversation transcript.