On Monday, the global cloud platform Cloudflare, known for its advanced DDoS protection and developer platform, announced Workers Preview.

Workers Preview aims to support users who rely on AI agents for code creation. “Agents are helping us push more lines of code than ever before, and larger changes mean more ground needs to be tested ahead of release.” This gives these developers a place to test and play around with their application before it hits production.

The isolated environment gives you access to the entire developer platform: R2, KV, D1, Workers AI, Browser Rendering, email sending, and more. Each environment has a public preview URL and supports its own variables, bindings, and secrets without affecting your production deployment. Preview environments also feature their own traces, metrics, errors, and observability logs separate from production.

The goal is to eliminate the pre-production loop, where you push changes, deploy, test, find an issue or error, push a new change, deploy again, and repeat—that typically happens in production and risks impacting real-world users.

Every Git branch gets its own environment. When you want to add a new feature as a developer, you create a new Git branch to work on that feature without affecting your main branch. Workers Preview works similarly. When you push changes to any Git branch in your repository, Workers will deploy a new preview of those changes with all your custom-set bindings and environment variables.

A simple run of npx wrangler preview will deploy and run a preview of your current Git branch on its own workers.de` domain (or custom domain, if you have one connected). Preview URLs are similar to version URLs and follow this format: <preview-name>-<worker-name>.<subdomain>.workers.dev or <preview-name>.app.example.com.

Previews do not share settings with your production environment, so you will need to migrate your variables and secrets over. Fortunately, Cloudflare has added a useful button to quickly copy your secrets.

You will also be able to quickly switch between branches using a helpful dropdown menu found in the breadcrumbs.