Skip to main content
HS
HiSETSuccess
LeetCode Prep

Agent Engineering

From autocomplete user to superstar developer — coding agents, context, skills, MCP, hooks, spec-driven and parallel workflows, and building your own agents.

Lab · Advanced · 90 min

LangGraph Interrupt Before a Write Tool

Build a support agent that drafts refunds, pauses with interrupt() for human approval, resumes on the same thread, and never double-charges on resume.

LangChain / LangGraph

Show all 4 steps

Step 1 of 4

Lab brief

Goal

A checkpointed graph with an approval step, idempotent side effects, and a test that proves resume safety.

Failure mode

The refund API is called before interrupt() in the same node; on resume the node reruns and the customer is refunded twice.

Staff move

Put approval in its own node, perform side effects only after approval with an idempotency key, and test the resume path explicitly.