AI Hints
Home›LangGraph Tutorial›Human in the Loop
LangGraph · Lesson 55 of 120

Human in the Loop

Why pause.

⏱ 2 min read▶ Video at 58:19🎓 Free
Watch this lesson in the LangGraph courseWatch on YouTube ↗Full LangGraph course

Some actions shouldn't happen without a person checking first. Refunding money. Placing a large order. Emailing a customer. Human in the loop means the graph pauses, waits for a decision, and then carries on.

Human in the Loop
From the video: Human in the Loop
  • Some actions need a person
  • Pause and wait
  • Then carry on

Pause and resume

Here's the pattern. The graph runs until it reaches a risky step. It pauses, and saves its state with the checkpointer. A person reviews the request, maybe hours later. Then the graph resumes, with their decision.

  1. Run
  2. Reach a risky step
  3. Pause and save
  4. Human decides
  5. Resume
Pause and resume
From the video: Pause and resume

What a human can do

At a pause, a person can do several things. Approve the action. Reject it. Edit it, like changing an amount. Or answer a question the agent asked. LangGraph supports all of these.

keyvalue
Approvego ahead
Rejectdon't do it
Editchange the details
Answergive information

Summary

Human in the loop pauses a graph at risky steps, waits for a decision, and resumes. It needs a checkpointer to save the paused state. Next, the interrupt function.

Key takeaways
  • Pause at risky steps
  • Saved by the checkpointer
  • Resume with a decision
Next up: interrupt — pausing a graph