LangGraph Agents

Course Content

LangGraph Agents

7 sections · 49 lessons

What is a “graph run,” and how does it differ from a single LLM call?


One research run, five super-stepsplan: split into3 sub-questionsresearch x3in parallelone 503,retriedafter 1 ssynthesisethe reportEND — statesaved per stepEleven model calls and nine searches, all inside one invoke.
A crash during synthesis resumes from the last checkpoint, so the nine searches are never paid for twice.

What you need to know

How a run ends

A run stops for one of three reasons:

  1. It reaches END — the normal finish. invoke returns the final state.
  2. A node calls interrupt() — the run pauses. The result contains an __interrupt__ key with the payload, and you continue later with Command(resume=...).
  3. It exceeds the recursion limit — the maximum number of super-steps — and raises GraphRecursionError. In LangGraph 1.x the default limit is very high (it is no longer 25), so set recursion_limit in the config yourself for any graph with a loop.

Run versus call

Single LLM callGraph run
ScopeOne request, one responseMany steps: models, tools, code
MemoryNoneState passed between steps
PathFixedChosen at runtime by edges
FailureRetry the callRetry one node, resume from the last checkpoint
IdentityNonethread_id and a checkpoint_id for every step

Ways to run a graph

  • invoke — run and return the final state.
  • stream — yield events as the run progresses (updates per node, tokens, custom progress).
  • ainvoke / astream — the async versions, for web servers.

A real-life example

A research agent for an investment team answers "Summarise the last four quarters of results for three listed paint companies."

One graph run looks like this: a plan node splits the question into three sub-questions; three research nodes run in parallel in one super-step; one of them gets a 503 error from the search API, and its retry policy tries again after one second and succeeds; a synthesise node writes the report. That is one run, eleven model calls, nine search calls and five super-steps. If the server restarts during synthesis, calling invoke(None, config) with the same thread_id resumes from the last checkpoint, so the nine searches are not paid for twice.

Follow-up questions to expect

  • "What happens to state when a run finishes?" — With a checkpointer it stays saved under the thread_id, and the next invoke on that thread starts from it. Without one, it is gone.
  • "Can two nodes run at the same time?" — Yes, when both are scheduled in the same super-step. That is why keys written by parallel nodes need reducers.
  • "What does invoke(None, config) do?" — It adds no new input and continues the thread from its latest checkpoint.