1:1 mentoring with Big Tech AI engineers
LLM & Agentic

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 for human review with interrupt() and resume it with Command
  • Build one gate that supports approve, edit and reject
  • Keep side effects out of the re-run window above the interrupt
04

interrupt(): Approval Gates

Any node can stop the graph, hand a payload to a human, and wait — across a redeploy if it has to. It is one function call, and it only works because the checkpointer is already there.

THE CENTRAL IDEA

interrupt() is not a blocking prompt. It writes a checkpoint, throws control back to whoever called invoke, and lets your process exit. Resuming is a fresh invoke on the same thread_id carrying a Command — which is why the checkpointer is what makes the pause useful, not what makes it happen.

interrupt() stops the graph, not the process — the gap can be days long
FIRST INVOKE propose drafts the refund approval_gate interrupt({…}) state written to the checkpointer PROCESS MAY EXIT minutes, or three days a human reviews the payload in your own UI SECOND INVOKE · SAME THREAD_ID approval_gate re-runs from the top Command(resume="approve") settle issues the refund The whole node re-runs on resume — interrupt() returns the human’s value the second time instead of pausing again. So anything above the interrupt call runs twice. Put side effects after it, or in the next node. Without a checkpointer the run still halts and hands back __interrupt__ — but nothing was written down, so it can never be resumed.

Related

More in LLM & Agentic

Get full access to all 74+ sections with code examples, diagrams, and interactive animations.

Unlock Premium