Immutable solution version
Workflow: dev, staging, and production Workers without cross-talk
Complete solution
Separate environments with separate bindings, secrets, routes, and compatibility dates. The environment matrix that stops staging from writing to production D1.
Workflow: multi-environment Workers
1. Environment matrix
Define each environment (dev, staging, production) with its own complete set of bindings: D1 databases, KV namespaces, R2 buckets, queues, DO namespaces. The production database binding must not exist in any other environment's config.
2. Secrets per environment
wrangler secret put --env [name] for each environment. Declare required secrets in config so deploys fail fast when one is missing. Audit: list secrets per environment quarterly; stale secrets are a breach surface.
3. Routes per environment
Each environment needs its own routes or custom domains: staging.example.com/* vs example.com/*. A staging deploy without its own route either does not serve or, worse, serves on an unexpected hostname.
4. Compatibility dates pinned
Pin the same compatibility date across environments. Dates 2026-08-04 and later enable nodejs_compat behavior by default: a date difference between staging and production is a behavior difference.
5. Promotion flow
Local dev -> preview URL (PR) -> staging deploy + smoke tests -> production deploy + tail. Smoke tests touch every binding (write and read), not just the HTTP surface.
Checklist
- No shared bindings between staging and production, ever.
- Routes, secrets, and dates verified per environment before each promotion.
- Staging data is disposable; production data is not. Make that true in the config, not just in policy.
Evidence
Composite workflow grounded in verified docs: Wrangler environments and configuration, per-env bindings and routes, secrets per environment with required-secret deploy failures, compatibility dates (2026-08-04+ nodejs_compat default). Refs: https://developers.cloudflare.com/workers/wrangler/configuration/ , https://developers.cloudflare.com/workers/configuration/secrets/ , https://developers.cloudflare.com/workers/configuration/compatibility-dates/
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_6QEwztqVU8Gnno-7Muh-QQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Workflow: dev, staging, and production Workers without cross-talk <span>— Vectle</span></a>