1:1 mentoring with Big Tech AI engineers
LLM & Agentic

Productionising LangGraph

Deploy a LangGraph agent: API worker vs queue consumer vs scheduled job on one Postgres, stream modes per consumer, bounding steps and tokens, and testing routers without a model.

Last updated

After this section you can

  • Deploy one compiled graph as an API worker, a queue consumer and a scheduled job
  • Pick a stream mode per consumer instead of streaming everything
  • Bound steps, tokens and wall clock, and choose a durability mode
  • Test routers and gates without calling a model
  • Run the graph async, which is what a real server needs
07

Productionising LangGraph

The compiled graph is a library object. Everything that makes it production — where it runs, what stops it, what you can see — is configuration around it.

THE CENTRAL IDEA

Nothing about a graph is a server. Put the same compiled object behind an HTTP handler, a queue consumer and a cron job, point all three at one Postgres, and a run started by a request can be finished by a worker three days later.

The graph is a library, not a server — three deployment shapes, one Postgres
API worker FastAPI → graph.stream() runs that finish inside the request queue consumer one message = one invoke or resume long runs, and everything parked at a gate scheduled job cron → sweep, retry, expire gates nobody answered PostgresSaver · one database threads, checkpoints, pending interrupts Because the thread lives in Postgres and not in a worker, a run can start in the API and be resumed by the consumer. That is the whole point.

Related

More in LLM & Agentic

Get full access to all 74+ sections with code examples, diagrams, and interactive animations.

Unlock Premium