Course Content
LangGraph Agents
7 sections · 49 lessons
What is a “graph run,” and how does it differ from a single LLM call?
What you need to know
How a run ends
A run stops for one of three reasons:
- It reaches
END— the normal finish.invokereturns the final state. - A node calls
interrupt()— the run pauses. The result contains an__interrupt__key with the payload, and you continue later withCommand(resume=...). - 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 setrecursion_limitin the config yourself for any graph with a loop.
Run versus call
| Single LLM call | Graph run | |
|---|---|---|
| Scope | One request, one response | Many steps: models, tools, code |
| Memory | None | State passed between steps |
| Path | Fixed | Chosen at runtime by edges |
| Failure | Retry the call | Retry one node, resume from the last checkpoint |
| Identity | None | thread_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 nextinvokeon 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.