Devflare Docs
Binding reference Bindings

Use Worker Loaders in a Worker

Worker Loader bindings let a Worker load additional dynamic Workers at runtime.

Add the Worker Loaders config, call from worker code, and start with the local test path Devflare supports.

Start with the config, wire the binding into worker code, then use the support section to decide whether local tests or Cloudflare-backed tests fit.

Config key
Authoring shape
Best for
Dynamic Workers where the app loads Worker code at runtime from an explicit source

Add the binding to config

Add to , then use the generated env binding from Worker code.

Keep the first version close to the route or handler that needs it; move to a helper only after the shape is obvious.

Smallest Worker Loader config

Use the binding from application code

After Devflare generates the worker env, import from and keep the first Worker Loaders path close to the route, handler, or service method that needs it.

Keep this first path small enough that the config, env binding, and user-visible behavior are easy to review together.

Load an explicit Worker payload

Local and Remote Support

Devflare can run useful Worker Loaders application behavior locally for ordinary development and tests. Cloudflare still owns production limits, quotas, billing, and deployed account behavior.

Full local support through Miniflare Worker Loader bindings and explicit pure-test Worker stubs. Start locally with with explicit Worker payloads or a pure stub; that lane should cover the normal Worker Loaders application flow without requiring a Cloudflare connection.

Use Cloudflare when the assertion depends on deployed limits, account state, lifecycle behavior, billing, or other production-only Worker Loaders details.

When this binding fits best

  • Use Worker Loaders when dynamic workers where the app loads worker code at runtime from an explicit source.
  • Keep binding names stable and uppercase in examples so generated Env declarations remain predictable.
  • Prefer Devflare native config while it covers the feature; use only for unsupported Wrangler-only fields.

Testing path

  • Start with with explicit Worker payloads or a pure stub for config-backed local worker tests.
  • Use / for small unit tests that only need deterministic application behavior.
  • Use Cloudflare-backed tests when the assertion depends on hosted platform behavior, account state, limits, billing, or production routing.

Open the next page when you need it