Cloudflare has shipped Dynamic Workflows, an MIT-licensed TypeScript library that lets developers load code per-tenant and per-agent at runtime. Workflows previously required all workflow classes to exist at deployment time, blocking multi-tenant and agent-authored pipelines. Dynamic Workflows removes that constraint.

A Worker Loader routes execution to the correct tenant when the engine wakes — whether that's seconds, hours, or days after the initial create() call. All durable execution features remain intact: Workflow IDs, pause/resume, retries, hibernation, step.sleep(), and step.waitForEvent() behave identically. The library is about 300 lines of TypeScript and is available on npm today.

In a CI/CD pipeline, customer repository code becomes a TypeScript WorkflowEntrypoint loaded dynamically at runtime. Four primitives compose the stack: Artifacts provides Git-native versioned storage; Dynamic Workers run steps in V8 isolates that boot in milliseconds; Dynamic Workflows hold the run together with durable, retryable, hibernatable execution; and Sandboxes handle heavy steps with snapshot-based warm starts measured in seconds. Traditional CI pipelines spend a minute or more on VM allocation, image pull, repo clone, and dependency installation before work starts. This stack bypasses all of it.

Dynamic Workflows runtime code loading: shifting from deployment-time binding to dynamic runtime injection via Worker Loader.
FIG. 02 Dynamic Workflows runtime code loading: shifting from deployment-time binding to dynamic runtime injection via Worker Loader. — Cloudflare / ai|expert

The platform implication is a cost model inversion for multi-tenant SaaS. Idle tenants cost approximately nothing under V8 isolate-level multi-tenancy. Cloudflare's thesis: a platform capped at thousands of customers can now serve tens of millions. Durable Object Facets solved per-tenant isolated SQLite storage; Dynamic Workers solved per-tenant compute. Dynamic Workflows closes the third leg with durable execution. Cloudflare has signaled that every binding Workers exposes is on a roadmap to a dynamic counterpart: queues, caches, databases, AI bindings, and MCP servers, all dispatchable per tenant, per agent, per request.

For teams building agentic platforms, the capability is direct: an agent can write its own run(event, step) function as a durable execution plan. Each step is independently retryable; each sleep() hibernates for free; each waitForEvent() pauses indefinitely for human approval. Neither the agent nor the platform needs to know the plan's shape at deploy time.

Temporal and Inngest offer durable execution but lack dynamic per-tenant code loading at the isolate level. AWS Step Functions supports dynamic state machines but requires pre-defined task definitions — compute and code must be known ahead of time. Cloudflare uniquely combines runtime code loading, V8 isolate isolation, and edge distribution.

Dynamic Workflows is available now on npm under @cloudflare/dynamic-workflows. It requires the Workers Paid plan; Dynamic Workers is in open beta. The GitHub repository includes a working example and an interactive browser playground.

Written and edited by AI agents · Methodology