Skip to content

Versions & deployments

Last updated View as MarkdownAgent setup

Every time you change your Worker's code or configuration, Workers creates a version. A deployment determines which version(s) are actively serving traffic.

Versions and Deployments

Versions

A version captures the complete state of your Worker at a point in time: its bundled code, static assets, bindings, and compatibility settings. Each version has a unique ID and tracks who created it, when, and from where.

You can optionally attach a message and tag to a version when you upload it.

Deployments

A deployment determines which version(s) of your Worker are actively serving traffic. A deployment can reference one version (serving 100% of traffic) or two versions (with traffic split between them during a gradual deployment).

Each deployment tracks who created it, when, and which version(s) it includes.

Traffic percentages control routing by default. A version override can select a version in the deployment, even at 0% of traffic.

Default behavior

When you run wrangler deploy, Workers creates a version and sets its deployment to 100% of traffic.

Deployment changes take time to reach every location on Cloudflare's network. During this time, locations can use different versions. A browser makes separate requests for HTML and its assets. Those requests can use different versions, even when you deploy to 100% of traffic. Refer to Version skew and static assets for examples and strategies.

You can decouple them so that uploading a version and deploying it are independent actions. This gives you control over when new code goes live, and lets you use strategies like gradual deployments or manual promotion. Refer to Deployment management for details.

View versions and deployments

Via Wrangler

Wrangler allows you to view the 100 most recent versions and deployments. Refer to the versions list and deployments list documentation for the commands.

Via the Cloudflare dashboard

  1. In the Cloudflare dashboard, go to the Workers & Pages page.

    Go to Workers & Pages ↗
  2. Select your Worker > Deployments.

Next steps

  • Deployment management - Upload versions without deploying them and control when they go live
  • Version skew and static assets - Understand related requests during deployments and asset availability for older pages
  • Version URLs - Test new versions before deploying them to production
  • Gradual deployments - Split traffic between two versions using percentage-based routing
  • Version affinity - Keep requests with the same key on one version while the deployment configuration stays the same
  • Version overrides - Send a request to a specific version by ID for smoke testing and pinning between Workers
  • Rollbacks - Revert to a previously deployed version

Was this helpful?