LangGraph human-in-the-loop patterns. Use when implementing approval workflows, manual review gates, user feedback integration, or interactive agent supervision.
View on GitHubyonatangross/skillforge-claude-plugin
ork-langgraph-advanced
plugins/ork-langgraph-advanced/skills/langgraph-human-in-loop/SKILL.md
January 25, 2026
Select agents to install to:
npx add-skill https://github.com/yonatangross/skillforge-claude-plugin/blob/main/plugins/ork-langgraph-advanced/skills/langgraph-human-in-loop/SKILL.md -a claude-code --skill langgraph-human-in-loopInstallation paths:
.claude/skills/langgraph-human-in-loop/# LangGraph Human-in-the-Loop
Pause workflows for human intervention and approval.
## Basic Interrupt
```python
workflow = StateGraph(State)
workflow.add_node("draft", generate_draft)
workflow.add_node("review", human_review)
workflow.add_node("publish", publish_content)
# Interrupt before review
app = workflow.compile(interrupt_before=["review"])
# Step 1: Generate draft (stops at review)
config = {"configurable": {"thread_id": "doc-123"}}
result = app.invoke({"topic": "AI"}, config=config)
# Workflow pauses here
```
## Resume After Approval
```python
# Step 2: Human reviews and updates state
state = app.get_state(config)
print(f"Draft: {state.values['draft']}")
# Human decision
state.values["approved"] = True
state.values["feedback"] = "Looks good"
app.update_state(config, state.values)
# Step 3: Resume workflow
result = app.invoke(None, config=config) # Continues to publish
```
## Approval Gate Node
```python
def approval_gate(state: WorkflowState) -> WorkflowState:
"""Check if human approved."""
if not state.get("human_reviewed"):
# Will pause here due to interrupt_before
return state
if state["approved"]:
state["next"] = "publish"
else:
state["next"] = "revise"
return state
workflow.add_node("approval_gate", approval_gate)
# Pause before this node
app = workflow.compile(interrupt_before=["approval_gate"])
```
## Feedback Loop Pattern
```python
import uuid_utils # pip install uuid-utils (UUID v7 for Python < 3.14)
async def run_with_feedback(initial_state: dict):
"""Run until human approves."""
config = {"configurable": {"thread_id": str(uuid_utils.uuid7())}}
while True:
# Run until interrupt
result = app.invoke(initial_state, config=config)
# Get current state
state = app.get_state(config)
# Present to human
print(f"Output: {state.values['output']}")
feedback = input("Approve? (yes/no/feedback): ")
if feedback.l