diff --git a/src/content/docs/workers/versions-and-deployments/index.mdx b/src/content/docs/workers/versions-and-deployments/index.mdx index 5c089c4e4a3..4a6b57ce2c7 100644 --- a/src/content/docs/workers/versions-and-deployments/index.mdx +++ b/src/content/docs/workers/versions-and-deployments/index.mdx @@ -41,7 +41,7 @@ You can decouple them so that uploading a version and deploying it are independe ### Via Wrangler -Wrangler allows you to view the 100 most recent versions and deployments. Refer to the [`versions list`](/workers/wrangler/commands/workers/#versions-list) and [`deployments list`](/workers/wrangler/commands/workers/#deployments-list) documentation for the commands. +Wrangler allows you to view the 100 most recent versions and deployments. These commands return metadata only, not the Worker cod itself. Refer to the [`versions list`](/workers/wrangler/commands/workers/#versions-list) and [`deployments list`](/workers/wrangler/commands/workers/#deployments-list) documentation for the commands. ### Via the Cloudflare dashboard @@ -51,6 +51,17 @@ Wrangler allows you to view the 100 most recent versions and deployments. Refer 2. Select your Worker > **Deployments**. +The Deployments tab shows the deployment history and IDs. It does not display the code of previous deployments. + +### Retrieve code from a previous deployment + +The Cloudflare dashboard and Wrangler do not provide a built-in way to download the code of a previous deployment. You can retrieve a specific deployment's code using the Cloudflare API: +```bash +curl -s -H "Authorization: Bearer " \ + "https://api.cloudflare.com/client/v4/accounts//workers/scripts//content/v2?deployment=" +``` +You can find the in the Deployments tab in the dashboard, or by running wrangler deployments list. The API token requires Workers Scripts: Read permission. + ## Next steps - [Deployment management](/workers/versions-and-deployments/deployment-management/) - Upload versions without deploying them and control when they go live