LangGraph in Production: The 12-Point Checklist Before Your Agent Takes Real Traffic
Take a LangGraph agent from demo to production. 12 checks covering checkpointers, persistence, retries, interrupts, identity, tracing and rollout.
Haziqa Sajid
Technical Writer
Taking a LangGraph agent to production means adding what the demo never needed: a persistent checkpointer, safe retries, limits on autonomous loops, per-agent identity, tracing, human approval and a way to recover runs that die mid-graph. This LangGraph production checklist covers all 12, with the API to use for each and the gaps you close outside LangGraph.
In IBM Research's study of agents in production, 68% execute at most 10 steps before a human steps in, and what usually stops them is operations rather than model quality. For how these checks fit into the wider stack, see our guide to running AI agents in production.
Why a working LangGraph agent can still fail in production
LangGraph saves graph state at each superstep, so a run always has a known point to resume from. Saving state is half of recovery. The other half is noticing that the process driving the run has died and starting it again, and LangGraph leaves that to you.
In production, processes die mid-run all the time. A deploy restarts the pod, the kernel kills a worker for using too much memory, or a network blip drops a tool call. The checkpoint sits safely in the database, and the thread goes nowhere until something calls it again. On open-source LangGraph, you build that something: failure detection, a resume trigger and a lock so two workers don't pick up the same thread_id.
Tracing and identity are also separate layers. LangGraph ships no tracing backend and no cryptographic identity between agents and tools, so you add both yourself.
Choosing a LangGraph checkpointer for production
A checkpointer is the object you pass to compile() that writes a snapshot of graph state after each step, keyed by thread_id. Which one you choose decides whether a thread survives a restart and whether more than one worker can serve it.
| Checkpointer | Survives a process restart | Works across multiple workers | Use it for |
|---|---|---|---|
InMemorySaver | Survives a process restartNo | Works across multiple workersNo | Use it forTests and notebooks only |
SqliteSaver | Survives a process restartYes, on one machine | Works across multiple workersNo (single file) | Use it forLocal development, single-node demos |
PostgresSaver | Survives a process restartYes | Works across multiple workersYes, with shared Postgres | Use it forMost self-hosted production deployments |
| Managed Agent Server persistence | Survives a process restartYes | Works across multiple workersYes | Use it forTeams on LangChain's hosted platform |
| Durable workflow runtime underneath (e.g. Diagrid) | Survives a process restartYes | Works across multiple workersYes, plus crash detection and automatic resume | Use it forLong-running or high-stakes agents where a stalled run must restart without an operator |
Redis, MongoDB and Oracle checkpointers also exist, according to the LangGraph persistence docs. They sit in the same row as PostgresSaver: shared storage, no crash detection.
Setting up the LangGraph Postgres checkpointer
Install langgraph-checkpoint-postgres, then open the saver as a context manager and call setup() once to create its tables:
from langgraph.checkpoint.postgres import PostgresSaver
DB_URI = ********
with PostgresSaver.from_conn_string(DB_URI) as checkpointer:
checkpointer.setup() # first run only: creates tables and indexes
graph = builder.compile(checkpointer=checkpointer)
graph.invoke(inputs, {"configurable": {"thread_id": "order-8812"}})Keep thread_id values under 255 characters with PostgresSaver, and use an ID from your own domain (an order or ticket number) so you can find the thread again when something breaks.
What LangGraph persistence does not do
A checkpointer writes state. It doesn't watch the worker that is running the next node, so when that worker dies, no component in LangGraph notices. The fault tolerance docs describe the fix: call invoke(None, config) with the same thread_id. Your code has to know which threads died and make that call.
It also doesn't stop two workers from resuming the same thread at once. If a health check restarts a slow worker while the old one is still running, both can execute the same node and both can call the same payment API. You need a lease or lock per thread_id, or a runtime that guarantees one owner per run. We cover the gap in more depth in why checkpoints aren't durable execution.
The 12-point LangGraph production checklist
1. Define what happens when a node fails
APIs time out, tools return unexpected formats and models emit tool calls that don't parse. Sort each failure into one of four buckets: transient (retry), permanent (don't retry), needs a person (escalate) or fatal (stop the run). Have every tool return a structured error your graph can route on, instead of a raw stack trace the model will try to interpret. Route to a fallback: a simpler tool, a cached answer or a human. An agent that stops safely does less damage than one that keeps retrying.
2. Make agent state recoverable
LangGraph state management runs through the checkpointer: every thread's state lives in it, which is what makes conversation memory, pauses and recovery possible. Use a persistent checkpointer from the table above, keep state small and JSON-serializable, and store large payloads (documents, images) by reference. When a run fails, resume from the persisted state instead of starting the thread over.
3. Make retries safe
Attach a RetryPolicy to nodes that call flaky services. The defaults are 3 attempts, a 0.5-second first interval, a backoff factor of 2 and jitter on. Add an error_handler for what happens after the last attempt fails:
from langgraph.types import RetryPolicy
builder.add_node(
"charge_payment",
charge_payment,
retry_policy=RetryPolicy(max_attempts=3, retry_on=ConnectionError),
error_handler=payment_error_handler, # runs once retries are used up
)A retry runs the whole node again. If charge_payment reached the payment provider before the connection dropped, the retry charges twice unless the call carries an idempotency key. Here's how to make LangGraph tool calls idempotent.
4. Put limits around autonomous execution
recursion_limit caps the number of supersteps in one run. The graph API docs put the default at 1,000 steps from version 1.0.6, which is far more than most agents should ever need. Set your own and treat hitting it as a routed failure:
from langgraph.errors import GraphRecursionError
config = {"recursion_limit": 40, "configurable": {"thread_id": tid}}
try:
result = graph.invoke(inputs, config)
except GraphRecursionError:
result = escalate_to_human(tid)Add per-node timeouts with builder.add_node("call_model", call_model, timeout=60). They apply only to async nodes, and LangGraph rejects a sync node with a timeout at compile time. Cap tokens per thread in your own code as well.
5. Give every agent its own identity
Give each agent a service identity separate from any human's, with permissions limited to the tools and data it needs. When agents call other agents or services, prove identity with certificate-based mTLS, signed tokens or platform workload identities, never a shared API key copied into every node.
6. Control which tools the agent can call
Decide outside the model which tools each agent may invoke, and enforce it with a policy check that runs before the call. Block and log anything not on the list. A prompt injection can change what the model asks for, but it can't change a policy the model never sees.
7. Trace the entire agent execution
LangSmith traces LangGraph runs, including model and tool calls, once two environment variables are set:
export LANGSMITH_TRACING=true
export LANGSMITH_API_KEY=********For code outside LangChain, such as a direct SDK call or your own HTTP client, add the decorator so it shows up in the same trace:
from langsmith import traceable
@traceable
def lookup_invoice(invoice_id: str) -> dict:
return billing_client.get(invoice_id)See the LangSmith tracing docs for EU endpoints.
8. Make production failures diagnosable
When a run fails, you need the failed node, its error, its timing and the state it started from. Traces give you the first three. The checkpointer gives you the fourth: graph.get_state(config) returns the latest snapshot for a thread, so you can see exactly what the node received. Link trace IDs to thread_id in your logs so one lookup finds both.
9. Test failure recovery before production
Unit-test nodes and routing functions in isolation, then run integration tests against real model APIs. Then test the failures themselves: kill the worker during a slow node, make a tool raise ConnectionError and make the model return malformed output. For each, confirm the thread resumes from the right node and that no side effect ran twice.
10. Keep a verifiable history of what the agent did
Record each action in a tamper-evident log: which agent identity acted, on which thread, which tool it called, the inputs and outputs, and the result. Checkpoints show state, not who changed it or whether anyone edited the record afterward.
11. LangGraph human in the loop with interrupt()
Call interrupt() inside a node to pause the graph and save its state. The value you pass is shown to the caller. Resume with Command(resume=value) on the same thread_id:
from langgraph.types import interrupt, Command
def approve_refund(state: State):
decision = interrupt({"refund": state["refund"], "reason": state["reason"]})
return {"approved": decision == "approve"}
config = {"configurable": {"thread_id": "refund-4471"}}
graph.invoke(inputs, config) # pauses at interrupt()
graph.invoke(Command(resume="approve"), config) # later, from any workerThree production details, all from the interrupts docs. On resume, the node runs again from its first line, so any code above interrupt() runs twice and must be idempotent; put side effects after it or in the next node. Don't wrap interrupt() in a bare try/except. And the checkpointer must be persistent: with PostgresSaver, a worker restart during the wait costs nothing, because any worker can resume the thread. With InMemorySaver, the paused run is gone.
A paused thread also waits indefinitely. Build your own reminder or timeout that escalates when nobody answers, and give the reviewer the trace, the user's original request and the agent's partial work.
12. Plan the LangGraph deployment and rollout
Ship a new graph version to a small share of traffic first and watch cost, latency, error rate and escalation rate before widening it. Keep a kill switch and a rollback path. A checkpoint stores state, not code, so a thread paused on Monday resumes on whatever graph you deploy on Tuesday. If you rename or remove a node, check how in-flight threads will resume before you roll out.
Automatic resume for stalled LangGraph runs with Diagrid
Checks 2, 3 and 9 all end in the same gap: something has to notice a dead run and restart it, with only one worker driving it. Diagrid fills that gap by running your compiled graph on Dapr Workflows.
You keep your LangGraph code. Install diagrid[langgraph] and wrap the compiled graph:
from diagrid.agent.langgraph import DaprWorkflowGraphRunner
runner = DaprWorkflowGraphRunner(
graph=graph.compile(),
name="schedule-planner",
)
runner.start()Each node becomes a durable workflow activity, and Diagrid records its result before the next node starts. If the process dies halfway through a node, Diagrid detects the failure and resumes the run on a healthy instance. Completed nodes are not run again, only the one that was interrupted. Diagrid also coordinates instances, so a restarted worker and a slow old one can't both drive the same run. That replaces the resume trigger, dead-worker detection and per-thread lock you would otherwise build for check 2.
The Diagrid AI agents quickstart includes a three-node LangGraph crash test. The app kills itself partway through the slow middle node, and on restart you can watch only that node run again.
Diagrid also gives agents cryptographic identity and signed execution history, which cover checks 5 and 10; those are explained with the rest of the full production agent stack.
The LangGraph production checklist at a glance
| # | Check | LangGraph feature | What's missing | Fix |
|---|---|---|---|---|
| 1 | CheckDefine failure handling | LangGraph featureerror_handler, conditional edges | What's missingA failure taxonomy | FixClassify errors; return structured tool errors |
| 2 | CheckRecoverable state | LangGraph featureCheckpointers | What's missingDead-worker detection and resume | FixPostgresSaver plus a resume trigger, or a durable runtime |
| 3 | CheckSafe retries | LangGraph featureRetryPolicy | What's missingIdempotent side effects | FixIdempotency keys on every external write |
| 4 | CheckExecution limits | LangGraph featurerecursion_limit, node timeout | What's missingToken budgets | FixCustom limit; route GraphRecursionError |
| 5 | CheckAgent identity | LangGraph featureNone | What's missingPer-agent workload identity | FixmTLS, signed tokens or platform identity |
| 6 | CheckTool access control | LangGraph featureNone | What's missingPolicy enforced outside the model | FixAllow-list checked before each call |
| 7 | CheckTracing | LangGraph featureLangSmith integration | What's missingTraces for non-LangChain code | Fix@traceable on custom functions |
| 8 | CheckDiagnosable failures | LangGraph featureget_state() | What's missingLink between traces and threads | FixLog trace ID with thread_id |
| 9 | CheckRecovery tests | LangGraph featureTestable nodes | What's missingCrash and duplicate-run tests | FixKill workers mid-node in staging |
| 10 | CheckVerifiable history | LangGraph featureCheckpoint history | What's missingWho acted; tamper evidence | FixSigned, append-only action log |
| 11 | CheckHuman in the loop | LangGraph featureinterrupt(), Command(resume=...) | What's missingWait timeouts and escalation | FixPersistent checkpointer plus reminder job |
| 12 | CheckDeployment and rollout | LangGraph featureNone | What's missingVersioning for in-flight threads | FixGradual rollout, kill switch, rollback plan |


