Skip to main content
LangGraph provides two APIs for agent workflows: the Graph API and the Functional API. Both share the same runtime (persistence, streaming, human-in-the-loop, and memory). The Graph API is the default. Prefer it for new LangGraph agents and for any workflow that benefits from explicit state, branching, or graph visualization. Use the Functional API when you need to deploy other frameworks on LangSmith Deployment. Wrap an existing Claude Agent SDK, Strands, CrewAI, AutoGen, or similar agent with @entrypoint and @task so Agent Server can run it with persistence, streaming, and tracing.

Graph API (default)

Choose the Graph API when you build with LangGraph itself:
  • Explicit shared state across nodes
  • Conditional branching and parallel paths that merge later
  • Graph diagrams for debugging and documentation
  • Team review of workflow structure
Start with the Build checklist for the Graph API or Thinking in the Graph API.

Functional API (other frameworks)

Choose the Functional API when you already have an agent in another framework and want LangSmith Deployment features without rewriting that agent as a graph:
  • Minimal changes to existing procedural or framework code
  • Standard control flow (if/else, loops, function calls)
  • Function-scoped values instead of a shared state schema
For the wrap-and-deploy pattern, see Deploy other frameworks. For Functional API concepts and how-tos, see the Functional API overview.

Side-by-side shape

The same small workflow looks different in each API. This example classifies a number, then returns a message:
The Graph API makes state and transitions explicit. The Functional API keeps ordinary control flow and passes values between tasks. You can still combine both APIs in one application when a linear Functional API sub-workflow sits inside a Graph API coordinator, or the reverse.

See also