interrupt(): Approval Gates
Pause a LangGraph run for human review with interrupt(), resume it with Command, and build one gate that supports approve, edit and reject without double-charging on re-run.
Last updated
After this section you can
- Pause a run with interrupt() and resume it with Command(resume=...) on the same thread
- Build one review node that handles approve, edit and reject without rewriting the model's turn
- Keep side effects out of the code that re-runs on resume
interrupt(): Approval Gates
Any node can stop the run, hand a payload to a person and wait, across a redeploy if it has to. This section shows the call, the resume, the one rule that bites (the node runs again), and approve, edit and reject in one gate.
interrupt() saves the state, returns its payload to your caller and ends the call. Resuming is a new call on the same thread with Command(resume=value): the node runs again from its first line, and this time interrupt() returns the value.