Skip to main content
A revision deploys a version of your application to an existing Agent Server on LangSmith Cloud. Create a revision to release code changes without creating another Agent Server.

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.
From the LangSmith UI, select Agent Servers, then select an Agent Server.
  1. In the Revisions section, below Details, select + New Revision.
  2. In the New Revision modal, specify the full path to the API configuration file, including the file name. For example, enter langgraph.json if the file is in the repository root.
  3. Choose whether to make the Agent Server shareable through Studio.
  4. 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.
  5. 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 to 180 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 by BG_JOB_MAX_DRAINS, which defaults to 50. It does not count toward BG_JOB_MAX_RETRIES.
  • Runs still inside a step when the grace period ends: The server cancels them and returns them to pending for 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.
On shutdown, the server gives JavaScript and stateless runs the grace period to finish instead of requesting a drain. Stateless runs have no checkpoint to resume from. For how graph code can react to a drain request, see Graceful shutdown.

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 pending for 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_RETRIES limits the total number of attempts, including the first, and defaults to 3.

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.
Interrupted revisions have undefined behavior. LangChain might remove this feature in the future.
To interrupt a revision:
  1. From the Agent Servers view, select an Agent Server.
  2. In the Revisions table, select the menu icon for the revision.
  3. Select Interrupt.
  4. Review the confirmation message, then select Interrupt revision.

See also