To route a LangGraph workflow based on a person’s reply, have the node that collects the reply return a Command with goto rather than adding a separate conditional-edge function for that decision. The node can also use update to change graph state. The interaction is a pause-and-resume cycle: call interrupt(), present its payload to a person, then resume the same thread with Command(resume=reply).
How the pause-and-resume cycle works
Place interrupt(payload) inside the node that needs a human decision. The payload is application-defined and should be JSON-serializable—for example, a question together with the proposal being reviewed. LangGraph pauses the graph and saves its current state through the configured checkpointer.
As an Amazon Associate I earn from qualifying purchases.
As LangChain’s interrupt documentation puts it: “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.” The application receives the interrupt payload, displays it to a person, and collects a reply.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsTo continue, invoke the graph again with Command(resume=reply) and the same thread configuration. The value supplied as reply becomes the return value of the suspended interrupt() call in the node. The node can then interpret that value and choose its next step.
#1 Best Overall
Route from the node that handles the reply
A node can return Command(goto=destination, update=state_changes). goto selects the next node; update applies changes to the graph state. Use a typed destination annotation, such as Command[Literal["apply", "revise"]], where appropriate to make the permitted destinations explicit.
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", "")})
This is illustrative pseudocode, not a tested, drop-in implementation. Adapt the state type, payload validation, and node names to your graph. LangChain’s tool-call review tutorial demonstrates the same general pattern: a human-review node returns Command(goto=...) to proceed with approval, modification, or feedback.
Keep conditional edges for decisions that belong elsewhere
Command and conditional edges are not mutually exclusive. Use Command when the node processing a human reply should make the routing decision, especially when that decision also updates state. A conditional edge remains suitable when routing logic belongs in graph-level routing—for example, deciding whether a model produced a tool call.
Recommended Free Tools
The documented review example uses both: a conditional edge handles a separate model-output decision, while the human-review node uses Command to route based on the person’s response. In the LangGraph.js Command API reference, Command is likewise described in terms of combining control flow with state updates.
Rank #3
| Question | Use Command when… |
Use a conditional edge when… |
|---|---|---|
| Where is the decision made? | The node handling the reply makes the routing choice. | Routing logic is separate from that node, such as a condition based on model output. |
| Should routing and a state change happen together? | Yes; return goto and update from the node. |
The condition is handled in graph routing rather than as a combined node return. |
| Are valid destinations constrained? | A typed Command destination annotation can express allowed nodes. |
Choose the conditional-edge approach when the condition itself is the clearest place to express the branch. |
Configure state persistence and resume the same thread
A resumable interrupt depends on saved graph state and a thread identifier. Compile the graph with a checkpointer, then use the same thread configuration when resuming so the new invocation continues the paused execution rather than starting a different one.
The review tutorial uses an in-memory saver as an example. The interrupt guide recommends a persistent checkpointer for production, where execution may need to survive beyond the lifetime of one process. Choose the checkpointer to suit your deployment; the example’s in-memory saver is not a substitute for production persistence.
Rank #4
- Compile with a checkpointer. Use a saver appropriate to the environment in which the graph runs.
- Invoke the graph with a thread identifier. Retain the thread configuration associated with the paused run.
- Present the interrupt payload. Collect the person’s response in your application.
- Resume with the same thread configuration. Invoke the graph with
Command(resume=reply); the resumed node receives that value frominterrupt().
Validate replies by re-entering the node
For input validation, the current interrupt guidance recommends one interrupt() call per node invocation. If a reply is invalid, save a revised prompt in state and route back to the node so it can pause again with the corrected prompt.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchAvoid calling interrupt() repeatedly inside a while loop in one node invocation. On resume, LangGraph replays the node from its beginning, so work performed before the interrupt can run again. Graph-level re-entry makes each validation attempt a distinct invocation and avoids treating one resumed interrupt as a continuation in the middle of a loop.
Quick Recap
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.




