19876
views
✓ Answered

Dynamic Workflows: Durable Execution for Multi-Tenant Platforms

Asked 2026-05-12 10:56:08 Category: Cloud Computing

The Evolution of Cloudflare Workers

Since its debut eight years ago, Cloudflare Workers has transformed from a developer-focused tool into a vast ecosystem that supports multi-tenant applications. Initially designed for individual developers to run serverless functions at the edge, the platform now enables organizations to let their own customers deploy custom code. Today, Workers powers use cases such as AI-generated implementations based on user descriptions, multi-tenant SaaS platforms where each customer's business logic is unknown TypeScript at runtime, autonomous agents that create and execute their own tools, and CI/CD systems where every repository defines a unique pipeline.

Dynamic Workflows: Durable Execution for Multi-Tenant Platforms
Source: blog.cloudflare.com

Three Key Dynamic Primitives

To accommodate this shift, Cloudflare introduced a set of dynamic primitives. Dynamic Workers, launched in open beta last month, allow platforms to spin up a sandboxed Worker instance from code provided at runtime—on the same machine, in single-digit milliseconds. Durable Object Facets extend this concept to storage, giving each dynamically loaded application its own isolated SQLite database that activates on demand, with the platform acting as a supervisor. Artifacts provide a Git-native, versioned filesystem that can be created by the tens of millions—one per agent, session, or tenant. Together, these tools handle compute, storage, and source control dynamically. But one piece was missing: durable execution.

The Durable Execution Gap

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

The Static Assumption

However, Workflows originally assumed that workflow code was part of a developer's deployment. A typical configuration includes a binding that points to a single class—one per deploy. This works well for traditional applications where all code is owned by the developer. But it fails when you need to let customers ship their own workflows. Consider an app platform where AI generates TypeScript for every tenant, a CI/CD product with per-repository pipelines, or an agent SDK where each agent defines a unique durable plan. In all these cases, the workflow differs for every tenant, agent, or request. There is no single class to bind. This is the same shape of problem that Dynamic Workers solved for compute and Durable Object Facets solved for storage.

Bridging the Gap: Dynamic Workflows

Today, Cloudflare announces Dynamic Workflows, which bridges durable execution and dynamic deployment. It allows platforms to define workflows at runtime, per tenant, per agent, or per session, without requiring a static binding. The workflow code can be provided dynamically—just like with Dynamic Workers—and the engine handles execution, state persistence, and recovery automatically.

Dynamic Workflows: Durable Execution for Multi-Tenant Platforms
Source: blog.cloudflare.com

How Dynamic Workflows Work

With Dynamic Workflows, the workflow definition is not baked into the deployment. Instead, the platform can hand the workers runtime some code at runtime—similar to Dynamic Workers—and get back an isolated, durable execution environment. Each workflow instance has its own state, can run for extended periods, and can be paused, resumed, or canceled. The engine ensures that each step is durably executed, even if the underlying infrastructure changes. This makes it possible to have thousands or millions of unique workflows running concurrently, each with its own logic and schedule.

Use Cases for Dynamic Workflows

  • Multi-tenant SaaS platforms: Each customer can define custom business logic that runs as a durable workflow, such as order processing, approval chains, or data transformation pipelines.
  • CI/CD systems: Each repository defines its own pipeline as a workflow, with steps for build, test, and deploy, all managed durably and independently.
  • Agent-based applications: Autonomous agents can create and modify their own durable plans, enabling adaptive behavior over long time horizons.
  • AI-generated code: AI can write TypeScript workflows on the fly for each user request, with the engine ensuring reliable execution and retry on failure.

The Future of Dynamic Execution

Dynamic Workflows completes the trio of dynamic primitives for compute, storage, and now durable execution. Platforms can now offer their customers fully customizable, resilient applications without worrying about underlying infrastructure. As agentic and multi-tenant architectures continue to grow, this capability becomes essential. With Dynamic Workflows, Cloudflare provides a scalable, secure, and performant foundation for the next generation of dynamic applications.