I'm trying to build a system where an agent drafts an email, but a human must approve it before it is sent. How does LangGraph facilitate pausing the graph and waiting for external input? I've seen mentions of "interrupts," but I'm not sure how to implement them in a web app.
3 answers
LangGraph provides a break_before or break_after parameter when compiling your graph. When the execution reaches an interrupt point, the state is saved to the checkpointer, and the process stops. The user can then inspect the state via a frontend, make edits if necessary, and "resume" the graph by sending a signal with the updated state. This is perfect for compliance-heavy industries like finance or healthcare where AI actions require human oversight. It effectively turns a synchronous chain into an asynchronous, manageable business process.
Can the human actually modify the state during the pause, or can they only click 'approve' or 'deny'?
The interrupt feature is great because it saves the exact state of the agent so you don't lose progress.
Exactly, it's essentially like hitting a breakpoint in a debugger, but for a live production AI workflow.
They can actually modify it. You can send a state update that replaces the draft content before triggering the 'resume' call, so the next node sees the edited version.