Module 11 · Notebook 02
GenAI 2026 · LangGraph

The graph stops.
A human answers.

PLAIN SCRIPT "fire Bob" send_email() already delivered nobody could stop it LANGGRAPH "fire Bob" agent ⏸ FROZEN you say yes → sent you say no → blocked
4
parts, and a pause needs all four
1
graph, two risk levels
2
threads pause independently
0
restarts — it resumes mid-node
Step 1 · the routing rule

Weather is free. Email is not.

One graph, one router. It reads the tool name, nothing else.

START agentthe model toolsruns for real human_approvalinterrupt() END no tool asked SAFE RISKY approved rejected result
Pick a question.
The router is four lines of Python: is there a tool call? is the name in RISKY? That's the whole safety gate.
Step 2 · the anatomy

Four parts. Remove one, it breaks.

Click a part to delete it and see what fails.

✕
without interrupt()
The node runs straight through. The email is already gone before anyone could look at it.
Module 10's HumanInTheLoopMiddleware is exactly these four, pre-packaged. We build them by hand so we can pause for any reason.
Step 4 · run until it pauses

This is what "paused" looks like

human review · graph frozen
toolsend_email
tojane@example.com
subjectMeeting confirmed
bodyHi Jane — confirming Tuesday 3pm. See you then.
reasonThis tool call needs a human before it runs.
thread_id: approval-jane  ·  nothing has been sent
what the state says
next('human_approval',)  \u2190 we are stopped inside this node
last msgAIMessage with a send_email tool_call
missingno ToolMessage yet \u2014 the tool never ran
Three signals, one meaning: the draft exists, the send does not.
what dies with the process
input("ok? ")
Kill the terminal and the pending decision is gone forever.
what survives it
interrupt + checkpointer
The API request ends. A reviewer opens the ticket tomorrow. Same graph continues.
Step 5 · you are the reviewer

Press one. Watch the graph obey you.

START agent tools ⏸ approval approved rejected
waiting for you
The graph is frozen inside human_approval.
Reject does not crash. It writes a ToolMessage saying the tool was blocked, so the model cannot claim it sent the email.
Step 5b · isolation

Approving Jane does not approve Bob

Two thread_ids. Two saved whiteboards. Two independent pauses.

thread_id approval-janepaused
thread_id approval-bobpaused
Lose the thread_id and you lose the pause. There is no other way back into that frozen node.
The idea people get wrong

Resume ≠ restart

Where does execution pick up after you answer?

WHAT PEOPLE ASSUME · restart from START START agent again new draft approved the wrong text ✗ unsafe WHAT ACTUALLY HAPPENS · continue inside the node interrupt() returns{"approved": True} same node, next lineCommand(goto="tools") the exact draft you saw ✓ safe
You type no. What happens next?
Step 7 · where this ships

Every one of these is the same four parts

Support
Refund over $50, "cancel my account".
shows: amount · customer · reason
Banking / trading
Wire transfer, place an order.
shows: destination · size · type YES
DevOps agent
kubectl delete, drop a table.
shows: the exact command
Email / CRM
Any outbound send. This notebook.
shows: to · subject · body
Healthcare / legal
Anything that leaves the building.
shows: draft · release or hold
Agentic RAG
Retries exhausted, still ungrounded.
next notebook → 03
Say this in an interview: "Risky tools never run in the same turn. We pause with a payload, store the state under a thread id, and resume from that node when a reviewer decides."
Recap

Four questions you should answer out loud

1 · PAUSEinterrupt(payload) 2 · PERSISTcheckpointer 3 · ADDRESSthread_id 4 · CONTINUECommand(resume=…)
What are the four parts?
Pause, persist, show a payload, resume with an answer.
Why the same thread_id?
It's the key to the saved whiteboard holding the unfinished review.
Why doesn't weather pause?
The router checks the tool name. Only names in RISKY divert.
What does "no" do?
Continues inside human_approval. No restart, no crash.
Why not input()?
It dies with the process. A pause must survive a deploy.
Next up
Notebook 03 — a helpdesk team, with this same pause on DB writes.