Skip to content

Rollbacks

Last updated View as MarkdownAgent setup

You can roll back to a previously deployed version of your Worker using Wrangler or the Cloudflare dashboard. A rollback creates a new deployment set to 100% of traffic for the selected version. It applies to your Worker's routes and domains.

The change takes time to reach every location on Cloudflare's network. Pages loaded before rollback can still request the newer version's assets. When planning rollbacks, check whether the older version includes those files. Refer to Version skew and static assets for ways to handle these requests.

You can roll back from any deployment, including:

  • A single-version deployment (rolling back replaces the current version with the selected version).
  • A split deployment with two versions (rolling back replaces both versions with the selected version at 100% traffic).

Via Wrangler

To roll back to a specified version of your Worker via Wrangler, use the wrangler rollback command.

Via the Cloudflare Dashboard

To roll back to a specified version of your Worker via the Cloudflare dashboard:

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

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

  3. Select the three dot icon on the right of the version you would like to roll back to and select Rollback.

Rolling back from a split deployment

If you are using a gradual deployment with two versions splitting traffic, rolling back will:

  1. Replace the split deployment with a single-version deployment.
  2. Route 100% of traffic to the version you selected for rollback.

This sends traffic to the selected version and removes the other version from the deployment. Overrides naming the removed version are ignored.

To roll back from a split deployment:

  1. Identify which version in your split deployment is stable and performing correctly.
  2. Use the rollback procedure or dashboard rollback to roll back to that version.
  3. The split deployment will be replaced with the selected version at 100% traffic.

Limits

Rollbacks limit

You can only roll back to the 100 most recently published versions.

Bindings

You cannot roll back to a previous version of your Worker if the Cloudflare Developer Platform resources (such as KV and D1) have been deleted or modified between the version selected to roll back to and the version in the active deployment. Specifically, rollbacks will not be allowed if:

  • A Durable Object class lifecycle change (via exports or the legacy migrations array) has occurred between the version in the active deployment and the version selected to roll back to.
  • If the target deployment has a binding to an R2 bucket, KV namespace, or queue that no longer exists.

Was this helpful?