How to Deploy LangGraph to Production
You built a LangGraph agent. It runs locally with nodes, edges, conditional routing, and stateful execution. Now you want to deploy it for others to use.
LangGraph adds complexity that plain LangChain chains don't have: state management, cycles, conditional edges, and long-running executions. That complexity matters in production.
The deployment challenges
State management — LangGraph graphs are stateful by design. Your StateGraph defines typed state that flows through nodes. Locally this lives in memory, but in production you need state that survives restarts, stays isolated between concurrent runs, and works across multiple machines.
Long-running executions — Graphs with conditional loops and multi-step reasoning can run for minutes. You need async execution, background processing, and streaming support to preserve LangGraph's event streaming capabilities.
Complex tracing — When a graph fails, debugging requires understanding which node threw the error, what the state was, whether conditional edges routed correctly, and if cycles ran as expected. Without proper observability, this becomes painful fast.
Add containerization, dependency management, scaling, versioning, auth, and rate limiting — you're building infrastructure instead of your product.
Deploy with Crewship
Crewship now supports LangGraph natively. If your project has a langgraph.json file, Crewship auto-detects it and handles everything.
Quick start
Install the CLI:
curl -fsSL https://www.crewship.dev/install.sh | bashLog in and initialize:
crewship login
crewship initCrewship detects LangGraph and generates a crewship.toml:
[deployment]
framework = "langgraph"
entrypoint = "src.my_graph.graph:graph"
python = "3.11"
profile = "slim"The entrypoint points to your compiled StateGraph object. No API code needed.
Deploy:
crewship deployYour code gets packaged, containerized, and deployed. You get a deployment URL and console access.
Add secrets:
crewship env set OPENAI_API_KEY=sk-... TAVILY_API_KEY=...
# Or import from .env
crewship env import -f .envSecrets are encrypted and injected at runtime.
Run your graph
From the CLI:
crewship invoke --input '{"messages": [{"role": "user", "content": "Research the latest AI papers"}]}'The CLI streams events as nodes execute in real-time.
From the REST API:
curl -X POST https://api.crewship.dev/v1/runs \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"deployment": "my-graph", "input": {"messages": [{"role": "user", "content": "Research the latest AI papers"}]}}'Execution traces map to your graph nodes — see which node ran, its state, output, and timing. When something fails, you'll see exactly where and why.
LangGraph.js support
Building with TypeScript/JavaScript? Crewship supports LangGraph.js with the same CLI workflow, API, and execution traces. Check out the LangGraph.js page for details.
What you get
All the infrastructure you'd otherwise build yourself:
Isolated execution — every run gets its own environment
Auto-scaling — scales up with demand, down to zero when idle
Deployment versioning — each deploy creates a new version, roll back anytime
Graph-aware traces — see nodes, state, timing, and token usage at each step
Webhooks — trigger runs from CI/CD, cron, or Zapier; get completion notifications
Token auth — API key authentication, manage keys from the console
Real-time SSE streaming — watch execution live or poll for results
Get started
Deploy your first LangGraph graph in minutes. No credit card required for the free tier.
If you're already using Crewship for CrewAI, the same account and CLI work for LangGraph. Just crewship init in your LangGraph project and deploy.