Overview
Cloudflare Workers supports two deployment methods:- Standard Deploy - Upload and immediately deploy to 100% of traffic
- Gradual Rollouts - Upload versions and control traffic distribution
Standard Deployment
Deploy your Worker directly to production:- Bundles your Worker code
- Uploads it to Cloudflare
- Deploys immediately to 100% of traffic
- Updates all configured routes and triggers
Deployment Options
| Option | Description |
|---|---|
--name <name> | Worker name (overrides config) |
--compatibility-date <date> | Compatibility date for runtime |
--compatibility-flags <flags> | Compatibility flags |
--minify | Minify the Worker code |
--no-bundle | Skip bundling step |
--dry-run | Build without deploying |
--outdir <path> | Output directory for build |
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:Deploy Versions
Deploy one or more versions with traffic splitting:- Select which versions to deploy
- Specify traffic percentage for each version
- Add an optional deployment message
Deploy Specific Versions
Shorthand Notation
Use the@ syntax for version-percentage pairs:
Version Upload Options
| Option | Description |
|---|---|
--tag <tag> | Version tag for identification |
--message <message> | Descriptive message for this version |
--preview-alias <alias> | Named alias for preview URL |
--compatibility-date <date> | Required: compatibility date |
--no-bundle | Skip bundling |
--dry-run | Build without uploading |
Traffic Splitting
When deploying multiple versions, traffic percentages must total 100%:Progressive Rollout Example
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
wrangler versions deploy:
Triggers and Routes
Routes, custom domains, and cron schedules are managed separately: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
- Use Versions for Production - Gradual rollouts reduce risk
- Add Metadata - Use
--tagand--messageto track versions - Test in Preview - Verify versions before deploying
- Monitor Metrics - Watch error rates during rollouts
- 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