Deployment
Dawn does not host or run production traffic itself. It owns local development (dawn dev, dawn run, dawn test) and the build step that produces deployable artifacts (dawn build). Production runs on LangSmith or another runtime that consumes the generated LangGraph entry files. Use live-server scenario tests to catch protocol-shape issues before deployment.
The deployment path
- 1
Verify locally
textdawn verifydawn verifyruns four checks in one call: app contract, route discovery, typegen, and deps (missing packages and missing env vars). Pass--jsonfor machine-readable output. The deps check is uniquely useful before a deploy — neitherdawn checknordawn typegencovers it.Optionally follow with scenario coverage:
textdawn test - 2
Confirm protocol parity
Run scenarios against a live dev server by setting
run.urlper-scenario in yourrun.test.tsfiles (the command-level--urlflag does not exist ondawn test).dawn devexposes LangSmith-style protocol endpoints —/runs/waitand/runs/stream— so this catches request/response shape issues before deploy. Process boundaries, state persistence, and tool bindings are still re-materialized bydawn buildfor production, so this step is necessary but not sufficient.textdawn dev --port 3001 & # In your run.test.ts: set run: { url: "http://127.0.0.1:3001" } per scenario dawn test - 3
Build the deployment artifact
dawn buildwrites.dawn/build/langgraph.jsonalong with per-route entry files under.dawn/build/<routeSlug>.ts. Foragentroutes, the generated entry imports your defaultagent()descriptor, materializes it as a LangGraph graph, and wires in every discovered route tool.textdawn build --cleanA typical generated
.dawn/build/langgraph.jsonlooks like:json{ "graphs": { "/hello/[tenant]#agent": "./.dawn/build/hello-tenant.ts:graph" }, "dependencies": ["."], "env": ".env.example", "node_version": "22" }Notes:
- Each
assistant_idis<routeId>#<kind>— e.g./hello/[tenant]#agent. Use this exact string asassistant_idin any client request. dependencies: ["."]andnode_version: "22"are required by LangSmith.envresolves to.env.examplewhen that file exists, else.env.- If you keep a hand-authored
langgraph.jsonat the app root,dawn buildshallow-merges it on top of the generated values.
- Each
- 4
Local middleware (optional)
src/middleware.ts(default-exporting a function fromdefineMiddleware) runs before local/runs/waitand/runs/streamrequests handled bydawn dev. Use it to gate access by header, populate request-scoped context, orreject(status, body)unauthorized callers during local development and live-server tests.dawn builddoes not currently materialize this middleware into the generated LangSmith entry files. See Middleware for the API. - 5
Push to your LangSmith-connected remote
LangSmith builds from the generated
langgraph.jsonand route entry files, then provisions assistants keyed by the<routeId>#<kind>ids. From there, your agents and harnesses can hit the deployed endpoints using those assistant ids.
What Dawn does not do
Self-hosting
If you can't or won't use LangSmith, build with dawn build and feed .dawn/build/ to your own container. The generated entry files and langgraph.json are the canonical interface — the in-process dawn dev runtime is a reference for the same protocol surface (/runs/wait, /runs/stream, /healthz), but is not intended as a production runtime itself.
Troubleshooting
- Tests pass in-process but fail live-server — a tool or route isn't serializing cleanly. Check that inputs, outputs, and state are JSON-serializable (no Dates, Maps, classes).
- Assistant id not found — the request
assistant_iddoesn't match the<routeId>#<kind>keys in.dawn/build/langgraph.json. Inspect that file directly (cat .dawn/build/langgraph.json) or rundawn verify --jsonto confirm what was discovered. - Type inference drifted — run
dawn typegenlocally and inspect.dawn/dawn.generated.d.ts. The generated file is ignored by the starter template, so regenerate it in CI/build steps unless your project chooses to commit.dawn/.