Dynamic Workflows: Durable Execution for Every Tenant

By

In the ever-evolving landscape of serverless computing, Cloudflare has introduced Dynamic Workflows, a new capability that marries durable execution with dynamic deployment. Initially, Workers enabled developers to run code on the edge, but as platforms grew, the need for multi-tenant isolation became critical. With Dynamic Workers, compute could be handed off to any user's code at runtime. Now, Dynamic Workflows extends this flexibility to long-running processes, allowing platforms to run durable workflows that are unique to each tenant, agent, or session without predefined bindings.

What exactly is Dynamic Workflows and how does it differ from standard Workflows?

Standard Workflows (now called Workflows V2) is Cloudflare's durable execution engine. You define a single class — like MyWorkflow — that runs steps which survive failures, can sleep for hours, wait for events, and resume exactly where they left off. It's perfect for traditional apps that own all their code. But the assumption is that the workflow code is part of your deployment, with one binding per class.

Dynamic Workflows: Durable Execution for Every Tenant
Source: blog.cloudflare.com

Dynamic Workflows removes that limitation. It lets you hand a workflow definition to the runtime at runtime — from your tenant's TypeScript, an AI-generated plan, or a pipeline configuration. The engine then executes that unique workflow durably, per tenant or per session, without you having to redeploy or pre-bind a class. In short: standard Workflows is for your code; Dynamic Workflows is for your users' code.

Why is the combination of durable execution and dynamic deployment important for multi-tenant platforms?

Multi-tenant platforms — like SaaS apps, agent frameworks, or CI/CD services — face a fundamental tension: they need to run custom logic for each tenant, but they also need that logic to be resilient and long-lived. Durable execution (surviving crashes, sleeping for days) is essential for workflows like onboarding flows or video transcoding. But if every tenant has a different workflow, you can't hardcode a single class into your deployment.

Dynamic Workflows solves this by letting the platform inject tenant-specific code dynamically while still leveraging the full durability engine. The platform sits as a supervisor, orchestrating isolated workflows for each tenant. This means you can offer your customers the power of durable execution without forcing them to become infrastructure experts, and without sacrificing isolation or performance.

Can you give concrete examples of use cases where Dynamic Workflows is a game-changer?

Absolutely. Consider these scenarios:

How does Dynamic Workflows relate to Dynamic Workers and Durable Object Facets?

These three products form a complete stack for dynamic, multi-tenant applications on Cloudflare. Dynamic Workflows adds durable execution on top of the compute and storage primitives.

Together, they let you build a platform where every tenant gets a fully isolated set of compute, storage, and now durable workflows — all managed dynamically.

Dynamic Workflows: Durable Execution for Every Tenant
Source: blog.cloudflare.com

What technical challenges did Cloudflare overcome to build Dynamic Workflows?

The core challenge was decoupling the workflow class definition from the deployment. In standard Workflows, the class is compiled into your deployment. With Dynamic Workflows, the runtime must accept arbitrary code at runtime, parse it, and instantiate it in a sandboxed environment — all while preserving durable execution guarantees.

Cloudflare leveraged the same isolation technology used in Dynamic Workers — creating a new isolate for each dynamic workflow instance. This ensures that tenant code cannot interfere with other tenants or the system itself. They also extended the durability engine to work with dynamically loaded classes, so sleep, wait, and resume operations remain seamless. Achieving single-digit millisecond instantiation and support for up to 50,000 concurrent instances required careful optimizations in the runtime and scheduler.

How will Dynamic Workflows impact developers building on Cloudflare?

For platform builders, Dynamic Workflows unlocks a new category of applications. Instead of writing rigid pipelines or onboarding flows, you can let your customers define their own durable workflows — whether through code, AI generation, or visual tools. This reduces your development burden and gives tenants unprecedented flexibility.

For individual developers, it means you can use Cloudflare as a backend for multi-tenant services without having to reinvent durable execution. You can ship features faster because you don't need to pre-provision infrastructure for each tenant's long-running processes. And because everything runs on Cloudflare's global network, latencies stay low even for complex, multi-step workflows.

Are there any limitations or prerequisites for using Dynamic Workflows?

Dynamic Workflows is a powerful tool, but it comes with some considerations. First, you must be comfortable with the dynamic deployment model — your platform needs to inject workflow code at runtime, which may require additional security scanning or validation. Cloudflare provides a sandboxed environment, but you should still vet tenant code for malicious intent if you don't control it completely.

Second, dynamic workflows are subject to the same rate limits and concurrency caps as standard Workflows (300 new instances per second per account, up to 50,000 concurrent). If you need more, you can request a limit increase. Finally, the code you inject must be compatible with the Workers runtime — Node.js modules or modern JavaScript/TypeScript. Legacy CommonJS or native bindings are not supported. Despite these constraints, for most multi-tenant use cases, Dynamic Workflows offers an unmatched combination of flexibility and durability.

Learn more in use cases and related products.

Tags:

Related Articles

Recommended

Discover More

What We Know About Apple's Rumored AI Pendant: Top 7 Questions AnsweredThe Ten Technological Foundations Driving 6G WirelessSwift Breaks Free: Expands IDE Support to Cursor, Antigravity, and More via Open VSXThe NHS’s Open Source Crackdown: A Misguided Response to AI Security Threats?Android Chief Dismisses Rumors of Apple-Style 'Liquid Glass' Redesign