Skip to content
masterclass Buddy

LangGraph · Function

compile

LangGraph models workflows as graphs of shared state, nodes, and edges. Build a StateGraph, add its nodes and transitions, then compile it before running it.

Last updated

Syntax

graph = StateGraph(State)
graph = graph.compile()
result = graph.invoke(input_state)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • StateGraph
  • START
  • END
  • Overwrite
  • Command
  • Runtime
  • checkpointer
  • reducer

Source: Graph API overview - Docs by LangChain. Checked 2026-11-03.