Most agent demos keep their state in memory and act without asking anyone. That's fine for a notebook, but it isn't acceptable when the agent can send an email or submit something on a user's behalf.
When I built a multi-stage automation agent in Python, I needed two properties:
Durability : if the process restarts halfway through a run, the run picks up where it left off.
A human gate : before any step with an external side effect, the agent stops and waits for a person to approve.
LangGraph provides both, through checkpointers and interrupts . Here is the minimal version of the pattern.
The graph
Three nodes: draft something, wait for approval, then act on it.
from typing import TypedDict from langgraph.graph import StateGraph , START , END from langgraph.types import interrupt , Command
class State ( TypedDict ): task : str draft : str approved : bool
def draft_node ( state : State ) -> dict : # call your LLM here; validate its output with Pydantic before trusting it return { " draft " : f "…