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