Technology

Dynamic Workflows: Cloudflare’s New Library for Per-Tenant Durable Execution

2026-05-10 11:06:41

Cloudflare has introduced Dynamic Workflows, an MIT-licensed library that brings flexible, per-tenant durable execution to its platform. Built on top of Dynamic Workers, this tool allows workflow code to vary dynamically at runtime based on the tenant, agent, or request. It addresses the need for platforms to serve millions of distinct durable workflows with minimal idle costs. In this Q&A, we break down what Dynamic Workflows are, how they work, and why they matter for CI/CD and agent plan execution.

What exactly is Dynamic Workflows?

Dynamic Workflows is a library released by Cloudflare under the MIT license. It extends Cloudflare’s existing durable execution engine so that the workflow code itself can change per tenant, per agent, or per request—all at runtime. Instead of having a single, fixed workflow for all users, developers can now define unique workflows tailored to each tenant or agent. The library leverages Cloudflare’s Dynamic Workers infrastructure to achieve this. This means that each tenant or agent gets its own customized durable execution path without sacrificing performance or scalability.

Dynamic Workflows: Cloudflare’s New Library for Per-Tenant Durable Execution
Source: www.infoq.com

How is Dynamic Workflows different from standard durable execution?

Traditional durable execution engines typically run the same workflow logic for every invocation. You define a fixed set of steps, and those steps are executed reliably, recovering from failures as needed. Dynamic Workflows flips that model by allowing the workflow code to differ per tenant, agent, or request. This is a major shift: it enables multi-tenant platforms to serve thousands or millions of unique workflows simultaneously, each with its own business logic. Built on Dynamic Workers, the library makes it possible to inject tenant-specific code segments at runtime, so the execution is not only durable but also highly customized.

What key problem does Dynamic Workflows solve?

The main problem Dynamic Workflows addresses is the inflexibility of traditional durable execution in multi-tenant environments. In many platforms, each tenant or agent may require slightly different workflow logic—for example, different approval steps, notification rules, or integration endpoints. Previously, developers had to either hardcode all variations into a monolithic workflow or spin up separate workflow instances per tenant, which was costly and complex. Dynamic Workflows solves this by allowing per-tenant code to load at runtime, providing a single scalable infrastructure that serves millions of distinct durable workflows at near-zero idle cost. This is particularly valuable for CI/CD pipelines and agent-based plan execution.

How does Dynamic Workflows achieve near-zero idle cost?

Dynamic Workflows is built on Cloudflare’s Dynamic Workers platform, which is designed to scale to zero when not in use. The library takes advantage of that architecture: each unique workflow is only instantiated when needed, and when idle, no compute resources are consumed. This is a dramatic shift from always-on virtual machines or containers. Because the workflows are durable and can resume from where they left off, the system can hibernate idle workflows entirely. As a result, serving millions of unique workflows costs almost nothing when they are not actively executing. This makes it economically feasible to have a separate workflow per tenant or even per request.

Dynamic Workflows: Cloudflare’s New Library for Per-Tenant Durable Execution
Source: www.infoq.com

What are the headline use cases for Dynamic Workflows?

Cloudflare highlights two primary use cases: CI/CD and agent plan execution. In CI/CD pipelines, each project or branch may have its own unique build steps, testing scripts, and deployment targets. With Dynamic Workflows, you can define a distinct durable workflow per project without managing separate infrastructure. For agent plan execution—such as in AI agent systems or multi-step task orchestration—each agent can have its own plan with custom logic. This allows platforms to run millions of unique agent plans efficiently. Both use cases benefit from the near-zero idle cost and the ability to vary code per tenant, agent, or request.

What role does Dynamic Workers play?

Dynamic Workflows is built directly on top of Cloudflare's Dynamic Workers technology. Dynamic Workers allows Cloudflare to run arbitrary user code on a per-request basis, mapping each request to the correct handler. By extending this concept to durable execution, Dynamic Workflows enables workflow code to be dynamic and tenant-specific. The library manages the lifecycle of these unique workflows, ensuring persistence and fault tolerance while leveraging Dynamic Workers’ ability to scale to zero. Essentially, Dynamic Workers provides the runtime environment and Dynamic Workflows adds durable execution semantics with per-tenant variability.

How can developers start using Dynamic Workflows?

Developers can access Dynamic Workflows as an open-source, MIT-licensed library. To begin, you simply include the library in your Cloudflare Workers project. The library provides APIs to define dynamic workflow logic per tenant, agent, or request. You can write workflow steps that load tenant-specific code at runtime using Cloudflare’s Dynamic Workers. The library handles durability, retries, and state management. Cloudflare provides documentation and examples for common patterns like CI/CD and agent plans. Because it’s MIT-licensed, you can also fork and customize the library for your specific needs. To get started, visit the official Cloudflare blog post or the GitHub repository linked from it.

Explore

10 Key Takeaways from Akamai's $1.8B AI Deal and Earnings Beat How to Future-Proof Your Career with Coursera's 2026 AI and Human Skills Programs 10 Essential Insights for Reviving the American Dream How to Harness Google’s Latest TPUs for Agent Training and State-of-the-Art Models Werewolf: The Apocalypse – Rageborn Transforms Tabletop Horror into a Metroidvania Adventure