interrupt
Pausing a graph.
To pause a graph, call interrupt inside a node. The graph stops right there, and saves its state. Whatever you pass to interrupt is shown to the person, so they know what they're deciding.

- Call interrupt in a node
- The graph stops
- Show what to decide
Pausing for a refund
The refund node calls interrupt, with the details a manager needs. The graph is compiled with a checkpointer, which interrupts require. Run it. Invoke returns early, and the result has an interrupt key holding our question. Get state shows the refund node is still waiting to finish.
from typing import TypedDict
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.graph import StateGraph, START
from langgraph.types import interrupt
class State(TypedDict):
amount: float
status: str
def refund(s):
decision = interrupt({"question": f"Approve a refund of £{s['amount']}?"})
return {"status": "refunded" if decision == "approve" else "declined"}
b = StateGraph(State); b.add_node(refund); b.add_edge(START, "refund")
graph = b.compile(checkpointer=InMemorySaver())
config = {"configurable": {"thread_id": "refund-1"}}
out = graph.invoke({"amount": 45.0}, config)
print(out["__interrupt__"][0].value)
print("waiting at:", graph.get_state(config).next){'question': 'Approve a refund of £45.0?'}
waiting at: ('refund',)About interrupt
Interrupt needs a checkpointer, and a thread ID. The value you pass should give the reviewer everything they need. When the graph resumes, the node runs again from the start, so keep work before the interrupt cheap, and safe to repeat.
| key | value |
|---|---|
| Needs | checkpointer + thread |
| Value | what to show |
| On resume | node reruns |
| So | keep earlier work cheap |
Summary
Interrupt pauses a node, saves the state, and shows a value to the reviewer. Next, resuming with their decision.
Key takeaways- interrupt(value)
- Returns early
- __interrupt__ in the result