Part 7 of 13 · 1 min read
How to build it so it holds up
- Put state in a store keyed by a run or thread id, and load it at the start of every request, so any worker can continue.
- Save before you wait and after each side effect, and give each side effect an idempotency key (module 6).
- Log model outputs and tool results, so replay and debugging use the recorded values.
- Version the schema and write migrations; refuse state newer than your code.
- Re-validate on resume: re-read the facts the next step depends on.
- Set retention: prune old checkpoints; LangGraph's documentation notes that they accumulate.
- Expire waits: a pause has a time limit after which the run is cancelled or re-planned.