Workers - Dynamic Workers, now in open beta
Key Points
- Spin up sandboxed Dynamic Workers in milliseconds
- Two load modes: one-time `load` and cached `get(id)`
- Helper libs: codemode, worker-bundler, shell
Summary
Dynamic Workers are now in open beta for all paid Cloudflare Workers customers. A Worker can dynamically spin up other Workers at runtime (Dynamic Workers) in a secure, sandboxed environment. Dynamic Workers start in milliseconds and are intended for on-demand code execution patterns such as LLM-driven code execution, AI agents, runtime bundling of npm modules, previews, and custom automations.
Key Points
- Runtime model: create and run ephemeral Workers from a parent Worker using
env.LOADER.load(...)and execute viaworker.getEntrypoint().fetch(request). - Two loading modes:
load(code)— one-time execution (equivalent toget()with a null id).get(id, callback)— cache a Dynamic Worker by ID to keep it warm across requests.
- Use cases: reduce LLM token costs by running code (Code Mode), execute AI agent tasks, run AI-generated prototypes in an isolated sandbox, build fast previews and custom automations.
- Helper libraries:
@cloudflare/codemode— run a singlecode()tool so an LLM can write/executed TypeScript that calls multiple APIs.@cloudflare/worker-bundler— resolve npm deps and bundle modules at runtime for Dynamic Workers.@cloudflare/shell— virtual filesystem with persistent storage backed by SQLite and R2 inside a Dynamic Worker.
- Pricing overview (summary): billed by Dynamic Workers created daily, requests, and CPU time; includes monthly allowances (10M requests, 30M CPU ms, 1,000 unique Dynamic Workers per month). The daily-created charge is not active yet; requests and CPU are billed via standard Workers rates.
- Security: Dynamic Workers run in an isolated sandbox;
globalOutbound: nullcan be used to block outbound network access.
Actionable next steps
- Try the Dynamic Workers Starter or Playground to prototype and test runtime bundling and execution.
- Read the Dynamic Workers docs for full API details and production configuration.