Use Dispatch Namespaces in a real application path
Dispatch namespace bindings let Workers for Platforms route requests to tenant Workers by name.
A compact Dispatch Namespaces recipe with config and worker usage in one application path.
Use this as the copyable starter before threading the feature into a larger application.
- Config focus
- bindings.dispatchNamespaces
- Runtime shape
- Best use
- platform Workers that dispatch to tenant Workers by name
Start by wiring the binding clearly in config
Smallest Dispatch Namespace config
Build the application flow around the binding
Treat this as the app-level Dispatch Namespaces path: the route, event handler, or service module receives a real request and uses the binding to do useful work.
Keep product limits, remote ownership, and fallback behavior visible in the code around the binding instead of hiding everything behind a vague utility too early.
- Keep the first example short enough to paste into a new Worker.
- Cloudflare owns dispatch namespace creation, tenant uploads, Worker metadata, and production routing.
Dispatch to one tenant Worker
Keep production boundaries visible
- Config focus: bindings.dispatchNamespaces.
- Runtime shape: .
- Best use: platform Workers that dispatch to tenant Workers by name.
Thread this into the next recipe
Once this smallest path works, add routing, generated types, and feature-specific abstraction in that order.
Previous
Testing Dispatch Namespaces
Test Dispatch Namespaces by choosing the local harness that matches the product boundary instead of reaching for Cloudflare by default.
Next
Workflows
Add the Workflows config, call from worker code, and start with the local test path Devflare supports.