Tapnod.All articles

Frameworks ยท 2026-11-26

LangGraph interrupt(): Pause, Review and Resume

A practical reference for LangGraph interrupt(): payloads, Command(resume), tool-level gates, parallel interrupts, validation, and the rules that prevent bugs.

The short answer

interrupt(value) pauses a LangGraph run inside a node, saves state through the checkpointer, and surfaces value to the caller. You resume by invoking the graph again with Command(resume=answer) on the same thread_id; interrupt() then returns answer and the node continues. That's the whole primitive.

This page is the reference companion to our LangGraph human in the loop guide: the payload design, the resume forms, tool-level gates, parallel interrupts and the rules that cause most bugs.

LangGraph interrupt payload surfacing to a reviewer and Command(resume) returning the answer

"langgraph interrupt" gets about 260 US searches a month at a keyword difficulty of 29, and "langgraph human in the loop interrupt" another 110 (Semrush, November 2026). These are developers in the middle of building something, which is why this page leans on code.

The anatomy of an interrupt

from langgraph.types import interrupt, Command

def approve_refund(state):
    decision = interrupt({
        "type": "approval",
        "title": f"Refund {state['amount']} to order {state['order_id']}?",
        "context": state["reason"],
        "default_on_timeout": "reject",
    })
    return {"approved": decision == "approve"}

# first run returns the payload under __interrupt__
result = graph.invoke({"order_id": "A-1042", "amount": 48, "reason": "Damaged on arrival"}, config)

# later, resume on the same thread
graph.invoke(Command(resume="approve"), config)

Three requirements: a checkpointer passed at compile time, a thread_id in config["configurable"], and the same thread_id on resume. Without a checkpointer there's nothing to resume.

Reading interrupts from the result

How you read pending interrupts depends on how you invoke:

Invocation Where interrupts appear
invoke() (default) result["__interrupt__"]
invoke(..., version="v2") result.interrupts, with state in result.value
Streaming with stream_events(..., version="v3") stream.interrupts

Each interrupt carries your payload and, when several are pending, an ID you use to target the resume.

Designing the payload

The payload is what a person sees, so design it like a notification, not a debug dump:

Field Why
type approval, question, edit or error, so a UI can render it properly
title One line a reviewer can decide from
context The few facts that matter: amount, environment, record count
proposal The exact SQL, email or action, for review or editing
default_on_timeout What happens if nobody answers

Payloads must be JSON-serializable, so pass dicts, strings and numbers, never functions or class instances.

Resume forms

Command(resume=...) is the only Command form meant as input for continuing; don't use update or goto as input to resume. What you pass is up to you:

  • Boolean: Command(resume=True) or False for simple approve or reject.
  • String: "approve", "reject", or a free-text answer to a question.
  • Dict: {"action": "edit", "sql": "..."} for edits with structured data.
  • Map of IDs: Command(resume={interrupt_id: value, ...}) when several interrupts are pending at once.

Newer LangGraph versions accept a response_schema on interrupt() to validate resume values with a Pydantic model, TypedDict or dataclass, so a malformed answer fails early instead of deep inside your node.

Gating a single tool

You don't need a separate node to gate a dangerous action. Call interrupt() inside the tool:

from langchain_core.tools import tool
from langgraph.types import interrupt

@tool
def send_invoice(customer_id: str, amount: float) -> str:
    """Send an invoice to a customer."""
    answer = interrupt({"type": "approval", "title": f"Send invoice of {amount} to {customer_id}?"})
    if answer != "approve":
        return "Invoice not sent: reviewer rejected it."
    return billing.send(customer_id, amount)

The rest of the agent runs freely; only this tool waits. Returning a clear message on rejection lets the model adjust instead of retrying blindly.

Parallel interrupts

When parallel branches each hit an interrupt, the run pauses with several pending, each with its own ID. Resume them together by passing a mapping from interrupt ID to answer. A UI should show them as separate cards, since they're separate decisions.

The rules that cause most bugs

  1. No broad try/except around interrupt(). It works by raising an exception; a bare except swallows the pause.
  2. The node restarts on resume. Code before interrupt() runs again, so make it idempotent or move side effects after the interrupt.
  3. Order matters. Resume values are matched to interrupts by position within a node; don't reorder, skip or loop interrupts based on data that can change between runs.
  4. One interrupt per node run for validation loops. Re-prompt through a conditional edge, not a while True loop inside the node.
  5. Subgraphs restart too. When a subgraph is called as a function, both the parent node and the subgraph node restart from their beginnings on resume.

Static breakpoints are for debugging

interrupt_before and interrupt_after pause the graph at node boundaries. They're handy while developing, but LangGraph doesn't recommend them for human-in-the-loop workflows. Use interrupt() for anything a real person answers.

Production notes

  • Use a durable checkpointer, so paused threads survive restarts.
  • Store thread IDs you can find again, ideally tied to a business object like an order or ticket.
  • Re-check the world after resume. A refund approved two days later may no longer be valid.
  • Decide what happens to abandoned threads: expire them, or nudge someone.
  • Log the answer and who gave it. See building an audit trail for agent decisions.

Testing interrupts

Interrupt logic deserves its own tests, because the failure modes are quiet. A useful test suite covers four cases:

  1. The pause happens. Invoke the graph and assert that the result holds exactly one interrupt with the payload you expect.
  2. Approve continues. Resume with an approving value and assert the side effect ran once, not twice.
  3. Reject stops. Resume with a rejection and assert the side effect never ran and the state records why.
  4. Restart is safe. Resume the same thread from a fresh process with a persistent checkpointer, which is what happens in production after a deploy.

The second test catches the most common bug: a side effect placed before interrupt() that runs again when the node restarts.

Getting interrupts to people

interrupt() gives you a payload and a pause; delivering it is your job. Options range from your own UI, to LangChain's open-source Agent Inbox, to an external inbox that collects pauses from several frameworks and returns answers by webhook or polling. Compare them in LangGraph Agent Inbox: setup and alternatives.

A worked example

Picture a support agent that drafts refunds. A node calls interrupt() with the order, amount and reason. A worker reads __interrupt__, posts a card to the support lead's inbox and stores the thread ID with the order. The lead approves from a phone; the webhook handler calls graph.invoke(Command(resume="approve"), config). Before issuing the refund, the next node re-checks that the order hasn't already been refunded, since two days passed. The payment goes through once, with a record of who approved it.

Key takeaways

  • interrupt() pauses and saves; Command(resume=...) on the same thread continues.
  • Design payloads for humans: type, title, context, proposal and a timeout default.
  • Gate single tools by calling interrupt() inside them.
  • Keep code before an interrupt idempotent, because the node restarts on resume.

FAQ

What does interrupt() do in LangGraph?

It pauses execution inside a node, saves state through the checkpointer, and returns a payload to the caller. The run continues when you invoke the graph with Command(resume=value) on the same thread.

How do I resume a LangGraph interrupt?

Call graph.invoke(Command(resume=answer), config) with the same thread_id you used for the original run.

Can I have multiple interrupts at once?

Yes. Parallel branches can each interrupt. Resume them together with a mapping from interrupt IDs to answers.

Why is my code running twice after resume?

The interrupted node restarts from the top on resume. Move side effects after the interrupt or into a separate node.

Where Tapnod fits

Tapnod can be where your interrupts land: connect the agent over MCP, webhooks or polling, and each pause shows up as a card you answer from your phone. Start free.

One inbox for every agent's questions

Approve plans and answer agents from web or phone. Start free.

Start free

Related articles