Agent skill · software engineering · jeremylongshore
langchain-langgraph-human-in-loop
Build LangGraph 1.0 human-in-the-loop approval flows with interrupt_before\
Why this skill is useful
Adds specific commands and patterns for implementing human-in-the-loop approval flows in LangGraph that are not commonly known.
What it needs
Requires langgraph, python installed locally. About 8k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
LangChain LangGraph Human-in-the-Loop (Python) Overview A team adds interruptbefore=["sendemail"] to require a human approval before the email goes out. First integration test crashes at the interrupt boundary with: The culprit is two nodes upstream: a classify node stashed "receivedat": datetime.utcnow() into state. Every node-level unit test passed because node completion does not serialize state — only the checkpointer does, and only at supersteps that include an interrupt. The failure is invisible until interrupt time (P17). A week later the resume path ships. The human reviews the draft, clicks "approve with edits," and the backend runs: The prior 47 messages vanish. messages was typed as plain list[AnyMessage] with no reducer, so update replaces the field instead of appending (P18). This skill covers: three interrupt styles (interruptbefore, interruptafter, inline interrupt()), the JSON-only state invariant with a pre-interrupt scanner, the Command(resume=...) / Command(update=..., resume=...) contract, an approval UI wire format (GET pending / POST decision with optimistic concurrency), safe-cancellation routing to END, and the tradeoff between native interrupts and a separate approval service. Pin: langgraph 1.0.x, langgraph-checkpoint 2.0.x. Pain-catalog anchors: P17, P18 (adjacent: P16, P20). Prerequisites Python 3.10+ langgraph >= 1.0, < 2.0 A checkpointer: MemorySaver (dev), PostgresSaver (prod), or SqliteSaver (single-box) A threadid contract at the app boundary (see langchain-langgraph-checkpointing) Familiarity with langchain-langgraph-basics — nodes, edges, TypedDict state with reducers Instructions Step 1 — Choose the interrupt style LangGraph 1.0 exposes three interrupt mechanisms. They are not interchangeable. Style Syntax Use when ------- -------- ---------- interruptbefore=[node] compile(interruptbefore=["sendemail"]) Review inputs before an irreversible tool. Graph pauses before node runs. State shown is the input. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/langchain-langgraph-human-in-loop--1a0f2b