Skip to main content

Overview

Cloudflare Workers supports two deployment methods:
  1. Standard Deploy - Upload and immediately deploy to 100% of traffic
  2. Gradual Rollouts - Upload versions and control traffic distribution

Standard Deployment

Deploy your Worker directly to production:
This command:
  • Bundles your Worker code
  • Uploads it to Cloudflare
  • Deploys immediately to 100% of traffic
  • Updates all configured routes and triggers

Deployment Options

Example Deployment

Gradual Rollouts (Versions)

Gradual rollouts allow you to deploy new versions incrementally by splitting traffic between multiple versions.

Upload a Version

First, upload your code as a new version without deploying:
1

Upload the version

Create a new version with optional metadata:
2

Review version details

The upload returns a Version ID:
3

Preview the version

If preview is enabled, access your version at:

Deploy Versions

Deploy one or more versions with traffic splitting:
The command will interactively prompt you to:
  1. Select which versions to deploy
  2. Specify traffic percentage for each version
  3. Add an optional deployment message

Deploy Specific Versions

Shorthand Notation

Use the @ syntax for version-percentage pairs:

Version Upload Options

A compatibility_date is required when uploading versions. Set it in your wrangler.json or pass it via --compatibility-date.

Traffic Splitting

When deploying multiple versions, traffic percentages must total 100%:

Progressive Rollout Example

1

Deploy canary (5%)

2

Increase to 25%

3

Roll out to 100%

Deployment Settings

Versioned Settings

These settings are part of each version:
  • Worker code and modules
  • Compatibility date and flags
  • Bindings (KV, R2, D1, Durable Objects, etc.)
  • Environment variables
  • Secrets
  • Placement configuration
  • Cache settings

Non-Versioned Settings

These settings apply globally and are not version-specific:
  • Logpush configuration
  • Tail consumers
  • Streaming tail consumers
  • Observability settings
Non-versioned settings are synced during wrangler versions deploy:
Changes to non-versioned settings take effect after running wrangler versions deploy.

Triggers and Routes

Routes, custom domains, and cron schedules are managed separately:
This is separate from version deployments to prevent accidental route changes during gradual rollouts.

Deployment Workflow Comparison

Standard Deploy

  • ✅ Simple and fast
  • ✅ Automatic trigger updates
  • ❌ No gradual rollout
  • ❌ Immediate 100% traffic

Gradual Rollout

  • ✅ Traffic splitting
  • ✅ Safe incremental rollouts
  • ✅ Version previews
  • ❌ More steps required
  • ❌ Separate trigger management

Best Practices

  1. Use Versions for Production - Gradual rollouts reduce risk
  2. Add Metadata - Use --tag and --message to track versions
  3. Test in Preview - Verify versions before deploying
  4. Monitor Metrics - Watch error rates during rollouts
  5. Keep Stable Versions - Maintain a known-good version for rollback

Next Steps

Version Management

List and view version details

Rollbacks

Roll back to previous versions

Secrets

Manage Worker secrets