Workflows
State machines, graphs & checkpoints
Model the flow as explicit states and transitions; save state after every step.
What it is and why it exists
Representing an agent or workflow as a graph (nodes = steps, edges = transitions, shared typed state) makes control flow visible, testable and resumable. A checkpoint is the saved state after a step: resume, retry from a point, or time-travel debug.
Quick prototype
Nested if-statements.
In production, at scale
Typed state schema, a checkpointer backed by Postgres or Redis, thread IDs per conversation, interrupts for human input, and tests per node.
Vendors and tools
| LangGraph | StateGraph + checkpointers (Postgres, SQLite, Redis) |
|---|---|
| XState | State machines in TypeScript |
| Step Functions ASL | State machines as JSON |
On AWS: Step Functions; DynamoDB as a checkpoint store.
How it fails
- State blobs that grow without limit
- Checkpoint contains secrets or full documents
What the interviewer asks next
What’s in a checkpoint?
The state after a step: messages or a summary, intermediate results, which step comes next and the IDs of side effects already performed.