Definition
A state machine models a system as explicit states and permitted transitions triggered by events or conditions. A state records where the process is. A transition defines when and how it may move somewhere else.
An agent workflow can be treated as a state machine when its carried state and transition rules are explicit. Examples include awaiting_approval, running, blocked, completed, and failed. Persisting those states outside the model lets a retry or restart determine what has already happened.
Finite-state machines have a defined set of states. Practical agent systems may also carry rich data, create tasks dynamically, and wait for external events, but the state-machine discipline still clarifies which transitions are valid.
Distinguish it from nearby terms
A state machine emphasizes valid states and transitions. A workflow emphasizes activities and outcomes. A control graph emphasizes possible paths. An execution trace records the transitions that actually occurred.
Check your understanding
An approval request exists only in chat history. After compaction, the agent deploys because it no longer knows approval was pending. An explicit awaiting_approval state would make that transition invalid.