Create a revision
When you create an Agent Server, LangSmith creates its first revision. Use the LangSmith UI or LangGraph CLI to create subsequent revisions.- LangSmith UI
- LangGraph CLI
From the LangSmith UI, select Agent Servers, then select an Agent Server.
- In the Revisions section, below Details, select + New Revision.
- In the New Revision modal, specify the full path to the API configuration file, including the file name. For example, enter
langgraph.jsonif the file is in the repository root. - Choose whether to make the Agent Server shareable through Studio.
- Add, remove, or update environment variables and secrets. The form does not show stored values. Leave a value as Unchanged to keep it, or enter a new value to replace it. For more information, see Environment variables.
- Select Submit. LangSmith queues the revision for deployment.
Update an Agent Server with active runs
An update gives active background runs time to stop before the old revision shuts down. You do not need to wait for every run to finish before creating a revision. Once the new revision is healthy, LangSmith sends a shutdown signal to the old revision. The shutdown grace period defaults to180 seconds. Configure BG_JOB_SHUTDOWN_GRACE_PERIOD_SECS to give longer runs more time. On LangSmith Cloud, the pod termination grace period is capped at one hour. LangSmith reserves part of that time for shutdown cleanup, so workers have less than an hour to drain.
Resume drained runs from a checkpoint
When drained-run resumption is enabled, the old revision asks eligible runs to stop at their next superstep boundary. A run must finish its first step before it can drain, so a run whose first step outlasts the grace period is canceled instead:- Drained runs: Each run returns to
pending. The next available worker resumes from the run’s latest checkpoint without repeating checkpointed work. A drain counts toward the per-run limit set byBG_JOB_MAX_DRAINS, which defaults to50. It does not count towardBG_JOB_MAX_RETRIES. - Runs still inside a step when the grace period ends: The server cancels them and returns them to
pendingfor retry. If a Python run wrote the thread’s latest checkpoint, the worker uses it to resume without resending the original input or command.
Drained-run resumption requires a Postgres-backed deployment with
langgraph>=1.2.15. The first stable release to support it was Agent Server v0.17.0, behind the FF_RESUME_DRAINED_RUNS flag. In v0.17.0 through v0.19.x, set the flag to true to turn it on. It is on by default starting in v0.20.0rc1.Retry runs without drained-run resumption
When drained-run resumption is disabled, the old workers wait for active runs to finish within the grace period:- Runs that finish within the grace period: Complete on the old revision.
- Runs that exceed the grace period: The server cancels them and returns them to
pendingfor retry. The worker sends the original input or command again, but a Python graph can still resume if it loads a checkpoint from the same run. Without a resumable checkpoint, the retry can repeat earlier work.BG_JOB_MAX_RETRIESlimits the total number of attempts, including the first, and defaults to3.
Best practices for rollout
- Keep checkpoints compatible with new code. A resumed run can execute on the new revision. Keep node names and state fields that existing checkpoints still reference. See LangGraph backward compatibility for patterns for changing graphs and state safely.
- Make external side effects idempotent. Work after the last checkpoint can run again. For example, use stable idempotency keys to avoid duplicate external writes.
- Size the shutdown grace period for your workload. With draining enabled, give the longest expected superstep time to finish, including node retries. Split long nodes into shorter steps if they frequently exceed the grace period. Set the grace period on the running revision ahead of the code rollout. Changing it only on the incoming revision does not extend the old workers’ grace period.
Interrupt a revision
Interrupt a revision only when it is stuck and prevents you from deploying another revision. To interrupt a revision:- From the Agent Servers view, select an Agent Server.
- In the Revisions table, select the menu icon for the revision.
- Select Interrupt.
- Review the confirmation message, then select Interrupt revision.
See also
Connect these docs to your agent of choice via MCP for real-time answers.

