Course

LangGraph from the ground up

Workflows that loop, pause and resume

  • Advanced
  • 10 chapters
  • 162 min read

State machines for AI workflows: a shared state, nodes as functions, conditional edges that route, loops with a cap, checkpoints that survive a crash, interrupts for human approval and a supervisor that routes between specialists. Every mechanism is built once in plain Python before the framework appears.

What You'll Learn

  • Explain when a workflow needs a graph instead of a chain
  • Design a state and choose reducers for each key
  • Wire nodes and edges, including an explicit entry point
  • Route conditionally and bound a loop with a cap
  • Save checkpoints and resume a run after a failure
  • Pause before an irreversible action and resume with a decision
  • Route between specialist agents with a supervisor
  • Build a writer-critic graph with approval and a revision limit

Prerequisites

  • Comfortable with Python functions, dictionaries and classes
  • The LangChain course is good preparation for the node and state ideas
  • No API key is needed — the examples run on plain Python

Vocabulary

The terms the chapters assume, in plain words.

checkpoint
A saved copy of the state after a step, stored under a thread so a run can resume or rewind.
compile
The step that checks a graph's connections and turns it into something that can be run.
conditional edge
A rule that reads the state and names which node runs next.
edge
A rule saying which node runs after the current one finishes.
entry point
The declared first node of a graph, marked by an edge from the start.
graph
A workflow drawn as nodes joined by edges, where the path can branch and loop.
interrupt
A planned pause before a node runs, so a person can approve, reject or edit first.
node
A function that reads the state and returns only the keys it changed.
reducer
A function that decides how an update is combined with the old value of one state key.
state
The shared record passed between nodes, holding every value the workflow needs to continue.
subgraph
A graph mounted inside another as a single node, with its own slice of state.
supervisor
A node that reads the state and chooses which specialist worker runs next, rather than answering itself.
thread
A named run whose checkpoints are stored together, so it can be listed, resumed or branched.

Course Content

  1. 01
    Graphs, not chains

    A chain runs once from left to right. A graph has a state, named steps, and the ability to go back — which is what real workflows need.

    Beginner · 13 min read

    Not started
  2. 02
    State and reducers

    A node does not replace the state, it returns an update. Whether that update overwrites or appends is decided by a reducer — and that choice explains most graph bugs.

    Beginner · 15 min read

    Not started
  3. 03
    Nodes and edges

    A node is a function of the state. An edge is a rule about which node runs next. Everything else in a graph is built from those two things.

    Beginner · 14 min read

    Not started
  4. 04
    Conditional edges and loops

    A router function reads the state and names the next node. Point it back at an earlier node and the graph loops — which is powerful, and needs a stop condition.

    Intermediate · 16 min read

    Not started
  5. 05
    Checkpoints and resumption

    A checkpoint is the state after every step, saved under a thread id. It turns a crashed run into something you can continue, and a finished run into something you can rewind.

    Intermediate · 16 min read

    Not started
  6. 06
    Human in the loop

    A graph can pause before a step, hand the state to a person, and continue with their decision. The pause is a checkpoint; the decision is just another update.

    Intermediate · 15 min read

    Not started
  7. 07
    Multi-agent patterns

    Several specialists, one router. The supervisor reads the state, picks a worker, and takes the result back — a graph whose nodes happen to be agents.

    Advanced · 16 min read

    Not started
  8. 08
    Subgraphs and composition

    A compiled graph is a callable, so it can be a node. Subgraphs keep a large workflow readable, as long as the state contract at the boundary is small, explicit and tested.

    Advanced · 17 min read

    Not started
  9. 09
    Durability in production

    A checkpoint survives a crash; it does not make a side effect happen once. Idempotency keys, retry policies, a lease per thread and a state migration are what turn resumption into durability.

    Advanced · 18 min read

    Not started
  10. 10
    Capstone: a writer-critic graph

    A draft, a critique, a revision loop with a cap, a checkpoint after every step, and an approval before anything is published. Every idea in the course, once.

    Advanced · 22 min read

    Not started