By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
Most requests on the Harbor Supply support graph finish in seconds: the router classifies, a tool reads an order, a node writes a reply. One class of request does not. A refund over $50 pauses at interrupt() until a human approves it, and the human may sign off on Friday for a run that started on Monday. Between those two moments the request survives a worker restart, a deploy, a database failover and a weekend. None of that survival comes from the HTTP request that started the run; it comes from the checkpoint.
This is the line between a graph you run and a system you operate. A run that lives for seconds can tolerate losing process memory: the customer retries and the graph runs again. A workflow that waits days cannot. LangGraph checkpoints after every superstep, so the real question is not whether state is durable but where each fact lives — process memory dies with the worker, the checkpoint store outlives it, and external systems remember what already happened whether or not you planned for it.
A production graph keeps its facts in three places, and mixing them up is the most common durability bug. Node locals and in-memory counters are scratch space: they vanish on restart. The checkpoint store is the run's memory: every channel value and the name of the next node. External systems — the payments ledger, the outbox, the mail provider — hold effects that already happened and cannot be un-happened. A design is durable only when it says which home each fact has, and a review can point at the home for every field.
| Fact | Durable home | If kept only in process memory |
|---|---|---|
| Channel values (order, intent, totals) | Checkpoint store, written after every superstep | A restart loses the customer's context |
Pending node (snapshot.next) | The same checkpoint record | A resume has nowhere to continue |
| Human approval decision | Checkpoint state plus an audit record | The decision is asked again or silently dropped |
| Vendor effect (charge, credit, email) | Vendor ledger keyed by intent | A retry cannot tell what already committed |
| Resume command | Queue with acknowledgement | A crash drops it; a redelivery duplicates it |
Once a graph is compiled with a saver, the run's identity is the thread id, not the process or the request. Invoking with {"configurable": {"thread_id": ...}} writes a checkpoint after each superstep, and graph.get_state(config) reads it back: the channel values and the tuple of nodes that run next. Resuming does not replay the conversation. It re-enters the graph at that pending tuple with the stored values, which is why an approval can land on a different worker days later.
from typing import Any
# One thread as a durable checkpoint store would hold it between two workers.
CHECKPOINTS: dict[str, dict[str, Any]] = {
"thread-c91": {
"values": {"order_id": "A17", "amount_cents": 8400},
"next": ("execute_refund",),
"step": 4,
},
"thread-d12": {
"values": {"order_id": "B05", "amount_cents": 3200},
"next": (),
"step": 7,
},
}
def resume_plan(store: dict[str, dict[str, Any]], thread_id: str) -> dict[str, Any]:
"""What a fresh worker does with one thread after a restart."""
snapshot = store.get(thread_id)
if snapshot is None:
raise KeyError(f"unknown thread {thread_id}")
pending = tuple(snapshot["next"])
return {
"thread": thread_id,
"completed_steps": snapshot["step"],
"pending": pending,
"action": "resume" if pending else "done",
}
for thread in ("thread-c91", "thread-d12"):
plan = resume_plan(CHECKPOINTS, thread)
print(plan["thread"], plan["action"], plan["pending"])The first thread has a pending tuple — its approval landed and it is resumable. The second has none: next is empty, its final superstep completed, and a fresh worker correctly reports it as done. That difference is the whole durability contract in one field, and it is the field a checkpoint migration must never lose. A database kill, a pod eviction or a rolling deploy changes which process serves the thread, never what the thread can do next.
InMemorySaver is a test double. Production needs a database-backed saver whose health check touches the real dependency, not a process-local dictionary that looks healthy right up to the restart.interrupt() and resume from the stored thread.Durability is only proven by a restart, so write the test as two separate graph builds. The first build pauses the run and records the thread id and snapshot.next; then the test throws the compiled graph away. The second build uses the same saver, like a deploy that replaced the process, and resumes the thread. Three assertions cover the contract.
snapshot.next names the node you expect and the payload carries the proposed action.The test needs no model and no key: the nodes are deterministic stand-ins and the only durable dependency is the saver itself. Run it in CI against the same saver class production uses, because the failure this guards against — a resume that starts at START and silently repeats work — only shows up when the checkpoint outlives the process.
Key takeaways
A run's identity is its thread id plus its checkpoint, not the process serving it, so a worker restart cannot lose a run whose supersteps were written to a durable saver.
Assign every fact to one of three homes: process memory for scratch, the checkpoint store for channel values and the pending node, and external systems for effects that already happened.
Resume re-enters at snapshot.next with stored values; it does not replay the conversation, which is why a pause can outlive a deploy and a weekend.
Long waits are data, not blocked nodes: interrupt() records a pause, while a sleeping node holds a worker hostage and loses the wait on restart.
Prove durability with a pause, a rebuilt graph and a resume on the same thread; deterministic nodes make the test keyless, and it is the only test that exercises the real failure mode.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.