LangGraph checkpointing persists a workflow’s graph state so an application can continue a conversation, pause for input or recover required state after an interruption. A resumable enterprise workflow also needs durable storage, caller authorization, safe handling of replayed code and duplicate-safe business operations. A checkpoint is not proof that an external side effect happened exactly once.
This guide demonstrates a small approval pause with no external side effects, then proposes the controls needed for durable deployment, concurrent workers and recovery. The example has been syntax-checked. It is not an integration-test report for a particular LangGraph release or database deployment.
What to understand before implementing checkpoints
- A thread identifier locates state; it does not authorize access to that state.
- In-memory checkpoints are useful for demonstrations but do not survive a process restart.
- Resuming an interrupted node can re-run code before the pause.
- External writes need their own operation identifiers, duplicate controls and reconciliation path.
- Graph state and long-term application memory have different scopes and lifecycles.
In this tutorial
Checkpoint, thread and store: different responsibilities
LangGraph uses checkpointers for thread-scoped graph state and stores for application data that can span threads. A checkpointer supports continuity for a particular workflow; a durable preference or shared fact belongs to a separately designed application memory scope. See the official persistence overview.
| Concept | Use | What it does not establish |
|---|---|---|
| Graph state | Current workflow data | That every fact is current or authorized |
| Checkpoint | A persisted workflow state snapshot | Exactly-once execution in another system |
| Thread identifier | Locate the intended workflow state | Permission to read or resume it |
| Store | Application-defined cross-thread data | Automatic ownership or retention rules |
| Business operation record | Track a consequential external operation | The same responsibility as conversation memory |
In a proposed enterprise implementation, an application record maps the authenticated caller to a permitted workflow reference. Only after authorization does the application pass the corresponding thread configuration to the graph. Do not expose an endpoint that resumes any thread merely because its identifier is known.
A minimal approval pause and resume
The following Python example has no model call, network request or business write. It pauses to ask for a decision, then returns the recorded Boolean outcome. Install and lock a compatible LangGraph release in an isolated environment before trying it. Consult the official interrupt documentation for the APIs supported by your selected release.
from typing import TypedDict
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.graph import StateGraph, START, END
from langgraph.types import Command, interrupt
class ReviewState(TypedDict):
proposal: str
approved: bool
def review(state: ReviewState) -> dict:
decision = interrupt({"proposal": state["proposal"]})
if type(decision) is not bool:
raise ValueError("A Boolean decision is required")
return {"approved": decision}
builder = StateGraph(ReviewState)
builder.add_node("review", review)
builder.add_edge(START, "review")
builder.add_edge("review", END)
graph = builder.compile(checkpointer=InMemorySaver())
config = {"configurable": {"thread_id": "demo-review-001"}}
paused = graph.invoke(
{"proposal": "Fictional read-only review", "approved": False},
config,
)
print(paused)
completed = graph.invoke(Command(resume=True), config)
print(completed["approved"])
The first call reaches the pause. The second resumes the same thread and records the decision. The in-memory checkpointer remains alive in this single process; restarting the script creates a new in-memory store. The demonstration’s hard-coded True is a test input, not an authenticated human approval and not permission to execute a real operation.
What to verify locally
Check that the initial call pauses, a Boolean resume value completes the state and an unexpected decision type is rejected. Use a separate thread identifier when testing independent workflows. Verify those behaviors through the actual SDK release rather than assuming a syntax check establishes runtime compatibility.
Move from a demonstration to durable storage
Choose a supported database-backed checkpointer appropriate to the deployment. The LangGraph memory guide shows database-backed setup examples. Pin compatible packages and test initialization and migrations in the intended environment.
The application design must also address database authentication, network access, encryption requirements, backups, retention and operational ownership. Avoid copying demonstration connection strings into production. Obtain credentials from the approved secret-management path and keep them out of graph state and model context.
Persist only required state
A checkpoint can contain messages, tool results or business references depending on the graph design. Review what is actually serialized. Prefer references to controlled records when full content is unnecessary. Set retention for checkpoints separately from audit evidence and long-term personalization memory.
For broader scope and lifecycle design, see AI agent memory architecture.
Keep replayed preparation separate from side effects
On resume, code before an interrupt in the interrupted node can run again. Therefore, do not put an unprotected irreversible write before the pause. Keep proposal preparation replayable and put consequential execution behind a separate, validated operation boundary.
In the proposed production pattern, the graph creates or references a stable proposal, pauses for review and then passes the approved proposal to an executor. The executor revalidates the exact payload and uses an operation reference tied to the business service’s supported duplicate-prevention behavior.
Checkpoint success is not business success
A workflow can persist “ready to execute” and then lose its connection after submitting the business request. The downstream change may already exist even if the workflow did not record completion. Use a reconciliation state and query the authoritative system before retrying an uncertain operation.
Similarly, a recorded model response or tool proposal does not prove execution. Preserve separate states for proposal, approval, execution attempt and confirmed result. See human-in-the-loop workflow design.
Control concurrent resumes and workflow versions
Two workers receiving the same review event can race. Define how the application claims a pending decision and prevents conflicting resumes. Use the chosen platform’s supported coordination mechanisms and test them with the actual backend. A database connection alone does not establish safe workflow concurrency.
Make review events reference an exact proposal version. If a proposal changes, the previous decision should not silently authorize the new one. Validate reviewer identity and eligibility before converting an external event into a graph resume value.
Plan for code changes while a workflow is waiting
A workflow may pause across application releases. Decide whether old runs continue on compatible code, are migrated through a reviewed path or are explicitly restarted. Preserve the relevant graph, tool and proposal version references. Do not assume a stored checkpoint can be replayed safely after arbitrary state-schema or node changes.
Record enough version information to investigate a failed resume, but avoid storing secrets or broad raw payloads merely for convenience. The workflow owner needs a clear process for old pending reviews, expired proposals and abandoned state.
A recovery test plan for resumable workflows
| Test | Expected property |
|---|---|
| Pause and resume in one process | The intended thread continues with the validated decision |
| Restart while awaiting review | Required state survives with the durable backend |
| Wrong or unauthorized thread | The application denies access before loading or resuming it |
| Duplicate review event | The workflow does not create duplicate business effects |
| Modified proposal | A stale decision cannot authorize changed parameters |
| Timeout after a write request | The workflow reconciles the authoritative outcome before retrying |
| Old workflow after deployment | The defined compatibility or migration policy is followed |
| Expired retained state | Cleanup respects the documented lifecycle and does not revive retired facts |
Run the restart, concurrency and migration cases against the intended persistent backend. An in-memory demonstration cannot establish those properties. Record actual results before claiming a production recovery objective.
Common checkpointing problems
The workflow starts over instead of resuming
Check that the authorized application selected the intended thread configuration and the same durable checkpoint source. A new identifier selects different state. Also distinguish a deliberate new run from resuming an existing paused one.
State disappears after restart
Check whether the implementation still uses an in-memory saver. Verify the persistent backend, credentials and environment configuration. Do not interpret a successful local demonstration as evidence of durable storage.
An action repeats
Inspect replayed code, duplicate review events and uncertain execution. Identify the actual business operation reference and reconcile the source of truth. Fix the execution boundary rather than merely suppressing a visible message.
A pending run fails after a release
Compare the stored state and graph versions with the new code’s expectations. Follow the planned compatibility or migration process. Do not silently discard a required approval history to make the workflow appear complete.
Common questions about LangGraph checkpoints
How do LangGraph checkpoints support long-running workflows?
Does InMemorySaver survive a process restart?
Does a thread ID authorize a user to resume a workflow?
Can code before an interrupt run again?
Do checkpoints guarantee exactly-once external writes?
Design recovery as part of the workflow
Discuss an AI agent integration assessment with Prominent AI Services LLP. Bring the pause points, business effects and restart scenarios that the workflow must handle.
Technical references reviewed 2 November 2026. The sample was syntax-checked; SDK integration, persistent storage and production recovery require environment-specific validation.
