Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/content/docs/workers/versions-and-deployments/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 <API_TOKEN>" \
"https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/workers/scripts/<WORKER_NAME>/content/v2?deployment=<DEPLOYMENT_ID>"
```
You can find the <DEPLOYMENT_ID> 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
Expand Down