Technology

Cloudflare's Dynamic Workflows: Customizable Durable Execution for Every Tenant and Agent

2026-05-09 23:49:17

Cloudflare has introduced Dynamic Workflows, an open-source library under the MIT license that brings flexible, durable execution to per-tenant, per-agent, or per-request code. Built on the foundation of Dynamic Workers, this library allows platforms to run millions of unique, long-running workflows with minimal idle cost. By enabling dynamic, runtime-defined workflows, it addresses key challenges in multi-tenant environments and agent-based systems. Below, we explore the details through a Q&A format.

What exactly is Cloudflare's Dynamic Workflows library?

Dynamic Workflows is an MIT-licensed library developed by Cloudflare that extends their durable execution engine. It allows workflow code to vary dynamically at runtime based on the tenant, agent, or individual request. This means that instead of a fixed workflow template, each invocation can have its own unique logic, steps, and behavior. The library is built on top of Dynamic Workers—Cloudflare's platform for serverless compute—and leverages its global network to coordinate and persist workflow state. By decoupling workflow definition from execution, Dynamic Workflows enables developers to create highly customized, stateful applications without managing infrastructure. The library handles retries, timeouts, and state persistence automatically, making it suitable for complex, long-running processes.

Cloudflare's Dynamic Workflows: Customizable Durable Execution for Every Tenant and Agent
Source: www.infoq.com

How does Dynamic Workflows differ from traditional durable execution engines?

Traditional durable execution engines, such as Temporal or AWS Step Functions, typically require workflows to be defined in a static, compiled format. All workflow instances of a given type share the same code, with variations handled via input parameters. Dynamic Workflows breaks this mold by allowing the workflow code itself to be different for each tenant, agent, or request. For example, a SaaS platform could define a "user onboarding" workflow, but each customer could have a completely different sequence of steps—some including custom API calls, others using specific approval logic. This is achieved without redeploying the workflow or managing separate deployment units. The library accomplishes this by using a per-invocation code provider that can fetch or generate workflow definitions at runtime, then execute them durably across Cloudflare's edge.

What are the primary use cases for Dynamic Workflows?

The two headline use cases highlighted by Cloudflare are CI/CD pipelines and agent plan execution. In CI/CD, each build environment or tenant may require a unique pipeline—different testing suites, deployment targets, or approval gates. Dynamic Workflows lets each pipeline be defined as a distinct durable workflow without sharing code or risking cross-tenant interference. For agent-based systems, such as AI agents or robotic process automation, each agent may have a custom plan of actions that needs reliable, durable execution. Dynamic Workflows can execute these per-agent plans with automatic retries and state persistence. Other potential uses include multi-tenant SaaS backends, personalized user journeys, and any scenario where workflow logic must be tailored dynamically without sacrificing durability or scalability.

How does Dynamic Workflows achieve near-zero idle cost for millions of workflows?

Cloudflare's execution model relies on its global edge network and the concept of durable objects that are only active when processing events. When a workflow is idle—waiting for a timer, a human approval, or an external webhook—it consumes no compute resources. The library stores the workflow's state and code metadata efficiently, so millions of idle workflows exist as lightweight records rather than running processes. Only when an event triggers the workflow does a Cloudflare Worker spin up to execute the next step. This design contrasts with traditional polling-based systems that may keep connections or processes alive. Dynamic Workflows also leverages the existing billing model of Workers, where you pay only for the compute time used during active execution steps, resulting in near-zero cost for idle workflows at scale.

Cloudflare's Dynamic Workflows: Customizable Durable Execution for Every Tenant and Agent
Source: www.infoq.com

Why did Cloudflare choose an MIT license for this library?

Cloudflare released Dynamic Workflows under the MIT license to encourage widespread adoption, community contributions, and ecosystem growth. The MIT license is permissive, allowing developers to freely use, modify, and integrate the library into both open-source and proprietary projects without legal friction. This openness aligns with Cloudflare's strategy of building platform primitives that the developer community can build upon. By making the library open source, Cloudflare also invites external review and collaboration, which can improve reliability and feature development. Furthermore, it positions Dynamic Workflows as a potential standard for per-tenant durable execution, similar to how other open-source projects have become industry norms. This move also differentiates Cloudflare from competing closed-source solutions offered by other cloud providers.

What role do Dynamic Workers play in the implementation?

Dynamic Workflows is built on top of Dynamic Workers, a Cloudflare capability that allows Workers to be created and deployed programmatically at runtime. Dynamic Workers provide the runtime environment for executing each distinct workflow step. When a Dynamic Workflow invokes an activity, the library uses Dynamic Workers to create an isolated execution context per tenant or agent. This isolation is crucial for multi-tenancy, ensuring that one workflow's code or failures don't affect others. Dynamic Workers also inherit the global distribution of Cloudflare's network, so workflow steps can execute close to the end user or data source. The library manages the lifecycle of these dynamic Worker instances, including scaling them down to zero when not in use. In essence, Dynamic Workers serve as the elastic compute fabric that makes per-tenant durable execution feasible and cost-effective.

Explore

How to Buy and Trade the New MegaETH Token: A Step-by-Step Guide Pyroscope 2.0: Revolutionizing Continuous Profiling for Modern Observability Intel Poaches Qualcomm’s 25-Year Veteran Alex Katouzian to Spearhead Client Computing and Physical AI Push Kaspersky Unveils New Security Category to Combat 'Grey Zone' Scams – Fake Extensions Top Global Threat Revolutionizing Spotify Ads Management: A Conversational Interface Powered by Claude Plugins