LLM Lab

Checkpoints & human approval

A graph that saves its state after every step can stop, wait for a person, and carry on later exactly where it left off.

Where this sits in a LangGraph application
State→Nodes→Edges & routing→Parallel (Send)→Checkpoints & interrupts→Several agents

Checkpoints and threads

Compile a graph with a checkpointer and LangGraph saves the state after every step. Each conversation or job is a thread, named by the thread_id in the config: invoking again with the same ID continues that thread, a new ID starts fresh. The saved checkpoints also let you inspect, replay or branch from any earlier step.

Human in the loop

Inside a node, interrupt(value) stops the run and hands value to whoever called the graph: a question, a draft, a proposed tool call. Nothing is lost while a person thinks. Invoking the graph with Command(resume=answer) and the same thread ID restarts that node, and this time interrupt returns the answer.

approvedpause: draft + questionCommand(resume=…)STARTdraftapproveinterrupt()sendENDpersonhours later
An approval step: interrupt pauses the run at approve and saves it; the person answers whenever they can, and Command(resume=…) continues from the same checkpoint.
from langgraph.types import interrupt, Command
from langgraph.checkpoint.memory import InMemorySaver

def approve(state: State) -> dict:
    decision = interrupt({"draft": state["draft"], "question": "Send this email?"})
    return {"approved": decision == "yes"}

graph = builder.compile(checkpointer=InMemorySaver())
config = {"configurable": {"thread_id": "ticket-7731"}}

graph.invoke({"request": "Reply to Lan about her refund"}, config)   # pauses at approve
graph.invoke(Command(resume="yes"), config)                          # continues from there
An approval step. The first invoke pauses at approve; the second resumes it with the person’s decision.

A worked example

A support graph drafts a refund email for ticket 7731 and pauses. The operator sees the draft hours later, edits the amount and resumes with the edited text; the graph sends the corrected email. If the server restarts in between, a database-backed checkpointer still holds the paused state, so nothing has to be redone.

Easy to confuse

Check yourself · 1 of 3

What does a checkpointer save?

Check yourself · 2 of 3

A node calls interrupt("Send this email?"). What happens next?

Check yourself · 3 of 3

When the run resumes, what runs again?

Read more in the books

  • LangChain and LangGraph documentation, LangChain: LangGraph: Persistence and Interrupts.
  • Learning LangChain, Mayo Oshin, Nuno Campos: the chapters on memory and human-in-the-loop.
All books
Labpause and resume
How to read this
  • The graph drafts an email, pauses at approve, then sends it or not. The stage map lights the current node; the checkpoint list grows by one entry per step, all under one thread_id.
  • At the pause, choose Approve, Edit or Reject. That choice is the resume value that interrupt() returns when the run continues.
Checkpoints · thread_id = "ticket-7731"