Intermediate10 min
Human-in-the-Loop
Pause execution for human approval, collect user input mid-run, and resume with Command.
Quick Reference
- →interrupt_before / interrupt_after: compile-time breakpoints that pause before or after a node
- →interrupt(): runtime function that pauses inside a node and surfaces a value to the user
- →Command(resume=value): resume a paused graph by injecting user input back into the node
- →GraphOutput.interrupts: v1.1 typed list of pending interrupts with their payloads
- →Approval pattern: pause before tool execution, show the user what will happen, resume or abort
Static Breakpoints
interrupt() pauses the graph — Command(resume) continues it
Compile-time breakpoints — always pause at a specific node
Static breakpoints are set at compile time via interrupt_before or interrupt_after. They always pause at the specified node, regardless of state. This is the simplest HITL pattern -- useful when you know at design time which nodes need human review. The graph checkpoints its state and returns control to the caller. The caller inspects the state, decides whether to proceed, and resumes (or aborts) by invoking again.