Human-in-the-Loop: Interrupt Before a Destructive Step
Intermediate · 30 minutes · 4 tasks, checked automatically · 100 points
In this lab you will build a LangGraph StateGraph that simulates a data-pipeline workflow. Before the graph executes a destructive 'delete records' step it pauses and waits for explicit human approval. You will use LangGraph's interrupt mechanism together with a MemorySaver checkpointer so that the graph can be resumed after the human reviews and approves the pending action. By the end you will have a reusable pattern for any workflow that must not proceed without human sign-off.
What you’ll learn
- Install LangGraph and its dependencies inside the toolbox container
- Build a StateGraph that uses interrupt_before to pause before a destructive node
- Approve the pending step and resume the graph using a MemorySaver checkpointer
- Verify the full pipeline ran to completion only after human approval
How this lab works
- Start the lab: One click starts a sandbox with a local model and the agent’s toolbox: no API key and no token bill.
- Work through 4 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work inspects the agent, its config and its output, and says what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: Locally, against a model on your computer: no API key, no tokens
- Model: qwen2.5:3b
- Open source: github.com/langchain-ai/langgraph
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop (or Podman / Rancher Desktop) installed and running
- A model sandbox started in the Agent Playground
Topics: langgraph, human-in-the-loop, interrupt, checkpointer, MemorySaver, StateGraph, resume, agents
Create a free account to start this lab.
Keep going
- Install, Inspect, and Disable an OpenClaw Plugin from ClawHub
- OpenClaw Message Queue Channel: Agent-Powered Request/Reply
- Shape Agent Behaviour with SOUL.md, USER.md and AGENTS.md
- Hermes Session Memory: Full-Text Search and Fact Recall
- Hierarchical CrewAI: Manager Agent Delegating to Specialists
- CrewAI Memory: Persistent Recall Across Executions