langgraph-human-in-the-loop
Pause graph execution for human review, approval, or validation, then resume with their input.
- Requires three components: a checkpointer (InMemorySaver or PostgresSaver), a thread ID in config, and JSON-serializable interrupt payloads
interrupt(value)pauses and surfaces data;Command(resume=value)resumes and returns that value to the paused node- All code before
interrupt()re-executes on resume, so side effects must be idempotent (use upsert, not insert) - Supports approval workflows, validation loops with re-prompting, and parallel interrupts resumed via ID-to-value mapping
interrupt(value)— pauses execution, surfaces a value to the callerCommand(resume=value)— resumes execution, providing the value back tointerrupt()- Checkpointer — required to save state while paused
- Thread ID — required to identify which paused execution to resume
Requirements
Three things are required for interrupts to work:
- Checkpointer — compile with
checkpointer=InMemorySaver()(dev) orPostgresSaver(prod) - Thread ID — pass
{"configurable": {"thread_id": "..."}}to everyinvoke/streamcall - JSON-serializable payload — the value passed to
interrupt()must be JSON-serializable
More from langchain-ai/langchain-skills
deep-agents-memory
INVOKE THIS SKILL when your Deep Agent needs memory, persistence, or filesystem access. Covers StateBackend (ephemeral), StoreBackend (persistent), FilesystemMiddleware, and CompositeBackend for routing.
7.7Klanggraph-fundamentals
INVOKE THIS SKILL when writing ANY LangGraph code. Covers StateGraph, state schemas, nodes, edges, Command, Send, invoke, streaming, and error handling.
7.1Klangchain-fundamentals
Create LangChain agents with create_agent, define tools, and use middleware for human-in-the-loop and error handling.
6.7Klangchain-rag
INVOKE THIS SKILL when building ANY retrieval-augmented generation (RAG) system. Covers document loaders, RecursiveCharacterTextSplitter, embeddings (OpenAI), and vector stores (Chroma, FAISS, Pinecone).
6.5Klanggraph-persistence
INVOKE THIS SKILL when your LangGraph needs to persist state, remember conversations, travel through history, or configure subgraph checkpointer scoping. Covers checkpointers, thread_id, time travel, Store, and subgraph persistence modes.
6.5Kdeep-agents-orchestration
INVOKE THIS SKILL when using subagents, task planning, or human approval in Deep Agents. Covers SubAgentMiddleware, TodoList for planning, and HITL interrupts.
6.3K