Empowering Multi-Tenant Platforms with Dynamic Durable Execution

From Usahobs, the free encyclopedia of technology

Introduction

When Cloudflare first introduced Workers eight years ago, the platform was designed primarily for individual developers. Over time, it has evolved into a robust ecosystem where not only developers but also entire platforms can build and scale applications. Today, we see a diverse range of use cases: from AI-powered applications that generate code on the fly to multi-tenant SaaS platforms where each customer's business logic is written in TypeScript at runtime, agents that create and run their own tools, and CI/CD pipelines defined per repository. This evolution has driven the need for more flexible and dynamic execution models.

Empowering Multi-Tenant Platforms with Dynamic Durable Execution
Source: blog.cloudflare.com

The Evolution: From Static to Dynamic Workers

Last month, with the open beta of Dynamic Workers, we provided platforms with a clean primitive for compute: hand the Workers runtime some code at runtime, and get back an isolated, sandboxed Worker on the same machine in single-digit milliseconds. This is a game-changer for platforms that need to run untrusted or tenant-specific code securely and efficiently.

Storage and Source Control Follow Suit

We extended this dynamic concept to storage with Durable Object Facets, allowing each dynamically loaded app to have its own SQLite database, spun up on demand, with the platform acting as a supervisor. Similarly, Artifacts brought dynamic deployment to source control: a Git-native, versioned filesystem that can be created in the tens of millions per agent, per session, or per tenant. So now we have dynamic deployment for both storage and source control. What was missing? The ability to execute long-running, durable workflows dynamically.

The Gap: Durable Execution Meets Dynamic Deployment

Cloudflare Workflows is our durable execution engine. It transforms a simple run(event, step) function into a resilient program where every step can survive failures, sleep for hours or days, wait for external events, and resume exactly where it left off after an isolate recycle. It's ideal for processes that extend beyond a single request: onboarding flows, video transcoding, multi-stage billing, and long-running agent loops. With Workflows V2, we now support up to 50,000 concurrent instances and 300 new instances per second per account, built for the agentic era.

However, Workflows had a key limitation: the workflow code was assumed to be part of your deployment. You'd have a wrangler.jsonc block specifying a single class to run per binding. This works fine if you own all the code, but fails when you want to let your customers ship their own workflows. Consider an app platform where AI writes TypeScript for each tenant, a CI/CD product where each repo defines its pipeline, or an agent SDK where each agent crafts its own durable plan. In these scenarios, the workflow is unique per tenant, per agent, or per request. There is no single class to bind.

Empowering Multi-Tenant Platforms with Dynamic Durable Execution
Source: blog.cloudflare.com

Introducing Dynamic Workflows

Today, we are bridging durable execution and dynamic deployment with Dynamic Workflows. This new capability allows you to define workflows dynamically at runtime, just as you can with Dynamic Workers for compute and Durable Object Facets for storage. Now, the workflow code can be provided by the tenant, the agent, or the pipeline, and executed in an isolated, sandboxed manner—complete with all the durability guarantees of Workflows.

How It Works

Dynamic Workflows follow the same pattern as our other dynamic primitives. At runtime, you hand the engine some code (e.g., a TypeScript class with a run method) and optionally a storage namespace. The engine spins up a dedicated, isolated workflow instance on the same machine, in milliseconds. Each workflow instance has its own execution state, own SQLite database, and own filesystem via Artifacts if needed. The platform sits as a supervisor, managing lifecycle, scaling, and security boundaries.

Use Cases for Dynamic Workflows

  • AI-Generated Workflows: Platforms where AI writes TypeScript for each user. The AI can generate a workflow that adapts to the user's request, with full durability.
  • Multi-Tenant SaaS: Each customer's business logic can be a workflow that runs billing, onboarding, or data processing, isolated from others.
  • CI/CD Pipelines: Each repository's pipeline can be a workflow, with steps that run, store artifacts, and wait for approvals.
  • Agent Orchestration: Agents can create and execute their own durable plans, persisting state and resuming after failures.

Conclusion

With Dynamic Workflows, we complete the vision of dynamic deployment for the entire application stack: compute, storage, source control, and now durable execution. This empowers platforms to offer their users the ability to run complex, long-running processes safely and efficiently. The era of static, monolithic workflows is over; dynamic, tenant-specific durability is here.