Skip to content
Cloudflare Docs

Local development

Test changes to your dynamic dispatch Worker by running the dynamic dispatch Worker locally but connecting it to User Workers deployed in production.

This is helpful when:

  • Testing routing changes and validating that updates continue to work with deployed User Workers
  • Adding new middleware like authentication, rate limiting, or logging to the dynamic dispatch Worker
  • Debugging issues in the dynamic dispatcher that may be impacting deployed User Workers

How to use remote dispatch namespaces

In the dynamic dispatch Worker's Wrangler file, configure the dispatch namespace binding to connect to the remote namespace by setting experimental_remote = true:

{
"dispatch_namespaces": [
{
"binding": "DISPATCH_NAMESPACE",
"namespace": "production",
"experimental_remote": true
}
]
}

This tells your dispatch Worker that's running locally to connect to the remote production namespace. When you run wrangler dev, your Dispatch Worker will route requests to the User Workers deployed in that namespace.

For more information about remote bindings during local development, refer to remote bindings documentation.