iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Use interrupt() to pause a LangGraph node for a human reply, then resume the same thread with Command(resume=reply). The suspended node receives that reply as the return value of interrupt() and can return Command(goto=..., update=...) to choose the next node and update state together. This can eliminate a separate conditional-edge function for the human decision; it does not eliminate conditional edges for other graph decisions.
How the human-reply flow works
- Pause in the node that needs a person. Call
interrupt(payload), passing a JSON-serializable prompt or review object for the application to display. - Save the graph state. Compile the graph with a checkpointer. The checkpointer saves the suspended execution so it can continue later.
- Present the payload and collect a reply. Your application handles the user interface; LangGraph does not prescribe how the person sees or answers the prompt.
- Resume the same thread. Invoke the graph with
Command(resume=reply)and the same thread identifier and configuration. - Route from the node. The resumed
interrupt()call evaluates to the reply. The node can return aCommandwith a destination and, if needed, state updates.
LangChain’s interrupt documentation states: “When you call interrupt within a node, LangGraph saves the current graph state using the checkpointer and waits for you to resume execution with input.”
Minimal pattern for a review node
This illustrative Python example shows the control flow. Adapt the state type, payload validation, and node names to your graph; it is not a tested, drop-in implementation.
from typing import Literal
from langgraph.types import Command, interrupt
def review_node(state) -> Command[Literal["apply", "revise"]]:
reply = interrupt({"question": "Approve this change?", "change": state["proposal"]})
if reply["approved"]:
return Command(goto="apply", update={"approved": True})
return Command(goto="revise", update={"review_note": reply.get("note", "")})
The human decision is handled where the reply is received. On approval, the node routes to apply and records approval; otherwise, it routes to revise and stores the note. The official tool-call review tutorial demonstrates the same general approach, with a review node returning Command(goto=...) for approval, modification, or feedback.
#1 Best Overall
What must be configured for resume
Use a checkpointer
A resumable interruption depends on saved graph state. The review tutorial uses an in-memory saver to demonstrate the flow, while the interrupt documentation recommends a persistent checkpointer for production. An in-memory saver is an example, not a substitute for durable persistence when an application needs to resume across process restarts.
Keep the thread identifier
Resume with the same thread identifier used for the interrupted run. The identifier ties the new invocation to the saved execution; starting a different thread does not resume that suspended state. Preserve the associated configuration when handing the interaction from the graph to your application and back.
Pass the human reply explicitly
Supply the reply as Command(resume=reply) in the new graph invocation. Inside the suspended node, interrupt() returns that value, so validate its shape and contents before using it to make a decision or update state.
When to use Command or a conditional edge
These mechanisms are not alternatives for every routing decision. Choose based on where the decision is made and whether routing belongs with a state update.
Rank #3
| Question | Command from a node |
Conditional edge |
|---|---|---|
| Where does the decision belong? | In the node processing the human reply. | In graph routing logic that evaluates a condition. |
| Can routing accompany state changes? | Yes. Command(goto=..., update=...) combines a destination and state updates. |
The routing decision is separate from a node return that updates state. |
| How are destinations made clear? | A typed destination annotation, such as Command[Literal["apply", "revise"]], can make allowed destinations explicit. |
The routing function and its possible destinations express the branch logic. |
| Can both appear in one graph? | Yes, for a reply decision made inside the node. | Yes, for another condition, such as whether a model produced a tool call. |
The official review tutorial uses both: a conditional edge handles a separate model-output decision, while the human-review node uses Command for its reply-based routing. Keep conditional edges wherever they make a distinct decision easier to understand; remove only the extra routing layer that duplicates a decision already made in the node.
Validate replies by re-entering the node
The interrupt guide recommends one interrupt() call per node invocation when handling input validation. If a reply is invalid, save a revised prompt or relevant validation state, then route back through the graph so the node runs again and asks for input again.
Rank #4
Avoid a loop that calls interrupt() repeatedly within one node invocation. Resuming replays the node from its beginning, which can repeat work performed before the interruption. Structure retries as graph-level re-entry instead, and ensure any repeated work is safe to run again.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Quick Recap
Practical checklist
- Put the interruption in the node that owns the human decision.
- Send a JSON-serializable payload containing the prompt and any necessary review context.
- Compile with a checkpointer and retain the thread identifier.
- Resume using
Command(resume=reply)and the same thread configuration. - Validate the reply, then use
Command(goto=..., update=...)when the decision and state change belong together. - Keep conditional edges for separate graph conditions rather than treating them as incompatible with
Command. - For a retry, update the prompt or validation state and route back to the node instead of repeatedly interrupting in one invocation.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

