megachangelog
Feature

Test every pull request in an isolated environment with Worker Previews

Worker Previews let you test each change in an isolated, production-like environment with its own code, configuration, URL, and observability. Each Preview gets a stable URL that updates with every push, full observability including logs and metrics, and can use production-like hostnames on custom domains for testing authentication and integrations before deploying to production.

You can now test every change you make in an isolated, production-like environment with Worker Previews ↗. Each Preview runs under the same Worker with its own code, configuration, URL, and observability, isolated from production and every other Preview.

Configure each Preview

Define the variables, bindings, and settings that new Previews start with in the previews block of your Wrangler configuration file. Set secrets with Wrangler commands. You can override one Preview without changing production or other Previews.

For Durable Objects and Containers, Cloudflare automatically provisions separate namespaces, storage, apps, and instances for every Preview. State changes, sessions, memory, migrations, and concurrent tests remain scoped to that Preview. To isolate KV, D1, R2, or another account-level resource, bind the Preview to a separate resource.

Diagram comparing production with three Previews, each with its own URL, code, configuration, and Durable Object state

Deploy and share every change

Use Wrangler 4.135.0 or later to deploy a Preview:

npx wrangler preview

Or connect your repository to Workers Builds to create Previews automatically and post their URLs to pull requests.

Each Preview gets a stable URL that updates with every push, so reviewers always see the latest changes. Each deployment also gets an immutable URL, so you can compare or return to an exact version.

After you create a Preview, use the environment breadcrumb next to your Worker's name to switch between Production and every Preview:

Worker dashboard showing the Preview dropdown and an overview of bindings, metrics, and deployments

Inspect and revise before production

Each Preview has its own logs, errors, metrics, and traces. Send traffic to its URL, inspect what happened, push a fix, and verify the next deployment before production.

Preview Observability tab showing success and error events for a pull request

Use production-like hostnames

Serve Preview URLs on workers.dev, a custom domain, or both. Custom domains let authentication providers, cookies, cross-origin resource sharing (CORS), and OAuth redirects work as they will in production. You can also protect Preview URLs with Cloudflare Access.

Configure a domain for Preview traffic from the Worker's Domains tab:

Domains tab showing a custom domain configured for Preview traffic

For setup instructions and current limitations, refer to the Worker Previews documentation.

workerspreviewtestingdeploymentci-cd

Source: original entry ↗

More from Cloudflare

Follow Cloudflare to get its new changes in your feed and email digest.

Feature

API Shield - Run schema learning on demand

API Shield now supports on-demand schema learning runs, allowing you to manually trigger learning after sending representative traffic to your API instead of waiting for the weekly schedule. This enables faster testing and validation cycles.

api-shieldapisecuritytesting
Feature

Cloudflare API MCP server now serves Cloudflare skills

The Cloudflare API MCP server now integrates with the Skills over MCP extension, allowing MCP clients to discover and access Cloudflare skills. Users can add the MCP server endpoint to compatible MCP clients to access these skills.

apimcpagentsintegrationextension
Feature

WAF failed detections field now available in Rules

A new cf.appsec.request.failed_detections field lets you control how rules handle requests when security detections fail. This array of detection IDs covers content scanning, WAF attack scoring, attack signatures, leaked credentials, and AI-based PII/prompt injection/custom topic detection failures, and works across custom rules, rate limiting rules, and request header transform rules.

wafrulessecurityapidetections
See all Cloudflare changes →