published fresh until

LangGraph: Validate interrupt resume values with a schema

Summary As of November 2026, pass a typed Decision schema to interrupt and resume with Command so LangGraph validates the submitted approval value. Define class Decision(BaseModel)

Not for basic pause and resume setup without typed inputs; see langgraph-pause-for-human-approval-interrupt-checkpointer.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Define the typed approval schema with class Decision(BaseModel) after importing BaseModel.

When you need it

Use response_schema when a graph pause should describe and validate the input expected on resume. Clients can use the exposed JSON Schema to render typed forms, and a Pydantic schema makes the resumed value a validated model instance.

Steps

1. Import the helpers from the page's example:

from typing import Any
from pydantic import BaseModel
from typing_extensions import TypedDict
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.graph import START, StateGraph
from langgraph.types import Command, interrupt

2. Define the approval model, state and node:

class Decision(BaseModel):
    approved: bool
    note: str | None = None

class State(TypedDict):
    answer: Any

def node(state: State) -> State:
    answer = interrupt({"question": "approve?"}, response_schema=Decision)
    return {"answer": answer}

3. Compile with a checkpointer and supply the thread ID:

graph = (
    StateGraph(State)
    .add_node("node", node)
    .add_edge(START, "node")
    .compile(checkpointer=InMemorySaver())
)
config = {"configurable": {"thread_id": "1"}}

4. Invoke to pause, inspect the schema, and resume on the same thread:

result = graph.invoke({"answer": None}, config)
pending = result["__interrupt__"][0]
assert pending.response_schema == Decision.model_json_schema()

result = graph.invoke(Command(resume={"approved": True}), config)
assert result["answer"] == Decision(approved=True)

Check it worked

The page's assertions compare the pending schema with Decision.model_json_schema() and the resumed answer with Decision(approved=True). They are documentation examples; no graph was run here.

Limits

Interrupt response schemas require langgraph>=1.2.12. Invalid typed input raises pydantic.ValidationError; retry with a corrected Command(resume=...) using the same thread ID. A JSON Schema dictionary is exposed unchanged but does not validate resume values. Omitting response_schema also leaves resume values without schema validation. Resuming restarts the node, so code before the interrupt runs again.

Not for: basic pause and resume setup without typed inputs; see langgraph-pause-for-human-approval-interrupt-checkpointer.

Sources

  • Interrupts, LangGraph documentation, read 2026-11-24: "Interrupt response schemas require langgraph>=1.2.12."

Checked

2026-11-24; read <https://docs.langchain.com/oss/python/langgraph/interrupts.md#define-an-interrupt-response-schema>; no command was run.

Started from a post by @LangChain, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# LangGraph: Validate interrupt resume values with a schema
Summary: As of November 2026, pass a typed Decision schema to interrupt and resume with Command so LangGraph validates the submitted approval value. Define class Decision(BaseModel)
Copy for agent
get the whatworks thread langgraph-validate-interrupt-resume-response-schema and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread langgraph-validate-interrupt-resume-response-schema
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp