LangGraph is a popular framework for building agents as graphs of steps, and it has first-class support for human in the loop. This guide explains how LangGraph human in the loop works, the patterns teams use for approvals, and how to decide which actions should pause — a question the framework deliberately leaves to you. APIs evolve, so check the current LangGraph documentation for exact signatures.

How LangGraph human in the loop works

LangGraph's approach centres on interrupts:

  1. Inside a node, you call interrupt() with a payload describing what needs review — for example, the tool call the agent wants to make.
  2. LangGraph saves the graph's state using its persistence layer (a checkpointer) and pauses execution.
  3. Your application shows the payload to a person.
  4. You resume the graph with Command(resume=...). The value you pass becomes the return value of interrupt() inside the node, and execution continues from there.

Because state is persisted, a paused graph can wait minutes or days, and resume on a different process. When a run is interrupted, the result includes an __interrupt__ entry you can detect.

Common approval patterns

  • Approve or reject a tool call. Pause before a sensitive tool runs; resume with approve or reject.
  • Edit before running. Let the reviewer change arguments — for example, lower a refund amount — then continue.
  • Review output. Pause after a step to check generated content before it's sent.
  • Collect missing input. Ask a person for information the agent can't get.

Pitfalls to know

  • Nodes re-run on resume. When you resume, the node containing interrupt() runs again from its start. Keep side effects after the interrupt, or make them idempotent.
  • Multiple interrupts. Order and determinism matter when a node calls interrupt() more than once; LangGraph's docs cover resuming several interrupts together.
  • A checkpointer is required. Without persistence, there's nothing to resume.
  • Interrupts aren't policy. The framework gives you the mechanism to pause. Deciding when to pause — and doing it consistently across every agent and tool — is up to you.

Deciding when to interrupt

Hard-coding if amount > 100: interrupt(...) inside nodes works for one agent. Across many agents, it leads to scattered thresholds nobody can review. A cleaner pattern:

  1. Before a sensitive tool runs, send the proposed call to a policy check.
  2. If the policy says allow, run it. If deny, return a reason to the agent.
  3. If the policy says require approval, call interrupt() with the call and the policy's reason, and route it to the named approver.

Your graph handles the pause; your AI agent policy decides when. For approval design beyond the mechanics, see AI agent approval workflow and the broader human in the loop for AI agents guide.

Recording decisions

Persisted graph state is not an audit trail. Record each decision — the call, the outcome, the approver and the rule — in an append-only AI agent audit trail, linked to the graph's run ID.

Where Gaten fits

Gaten can act as the policy check before tool calls in any framework: your code asks for a decision, and gets back allow, deny or require approval with a reason and a record. Talk to us about how this fits your LangGraph setup. See human approvals.

Frequently asked questions

How does human in the loop work in LangGraph?

A node calls interrupt(), LangGraph persists the state and pauses, and the application resumes it with Command(resume=value), where the value becomes the result of interrupt().

Do I need a checkpointer for LangGraph interrupts?

Yes. Interrupts rely on LangGraph's persistence layer to save and restore graph state.

Should every tool call in LangGraph be interrupted?

No. Pause only for actions your policy marks as needing approval; let routine actions run and deny actions outside the agent's authority.