langchain-ai avatar

Langgraph Human In The Loop

LangGraph's human-in-the-loop patterns are essential for building AI agents that need approval gates, error recovery, or validation loops. This skill covers the core mechanics: interrupt() to pause execution, Command(resume=value) to continue with human input, and the critical requirement for checkpointers and thread IDs. The examples walk through approval workflows, input validation loops, and multi-branch interrupts. The 4-tier error handling strategy alone makes this worth having. One gotcha to remember: when graphs resume, nodes restart from the beginning, so interrupt() calls need to come first to avoid re-running setup code.

skills.sh installs
18K
GitHub stars
1.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add langchain-ai/langchain-skills --skill langgraph-human-in-the-loop --agent claude-code

Installs into .claude/skills of the current project.

Files

LangGraph's human-in-the-loop patterns let you pause graph execution, surface data to users, and resume with their input:
  • interrupt(value) — pauses execution, surfaces a value to the caller
  • Command(resume=value) — resumes execution, providing the value back to interrupt()
  • 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:

  1. Checkpointer — compile with checkpointer=InMemorySaver() (dev) or PostgresSaver (prod)
  2. Thread ID — pass {"configurable": {"thread_id": "..."}} to every invoke/stream call
  3. JSON-serializable payload — the value passed to interrupt() must be JSON-serializable

Basic Interrupt + Resume

interrupt(value) pauses the graph. The value surfaces in the result under __interrupt__. Command(resume=value) resumes — the resume value becomes the return value of interrupt().

Critical: when the graph resumes, the node restarts from the beginning — all code before interrupt() re-runs.

Sponsors

Details

Repository
github.com/langchain-ai/langchain-skills
Categories
AI & Agent Building, Debugging

More from langchain-ai/langchain-skills

All 15
1github avatartypescript-mcp-server-generatorgithub/awesome-copilotGenerate a complete MCP server project in TypeScript using the MCP TypeScript SDK v2 (@modelcontextprotocol/server) with tools, resources, and proper configurat12.1Kskills.sh installs
2github avatarpython-mcp-server-generatorgithub/awesome-copilotGenerate a complete MCP server project in Python with tools, resources, and proper configuration10.5Kskills.sh installs
3github avatarboost-promptgithub/awesome-copilotInteractive prompt refinement workflow: interrogates scope, deliverables, constraints; copies final markdown to clipboard; never writes code. Requires the Joyri9.8Kskills.sh installs
4langchain-ai avatarlanggraph-clilangchain-ai/langchain-skillsINVOKE THIS SKILL when using the langgraph CLI to scaffold, develop, build, or deploy LangGraph applications. Covers langgraph new, dev, build, up, deploy, and 9.7Kskills.sh installs
5github avatarmcp-cligithub/awesome-copilotInterface for MCP (Model Context Protocol) servers via CLI. Use when you need to interact with external tools, APIs, or data sources through MCP servers, list a9.7Kskills.sh installs
6github avatarprompt-buildergithub/awesome-copilotGuide users through creating high-quality GitHub Copilot prompts with proper structure, tools, and best practices.9.4Kskills.sh installs