Cloudflare Introduces Dynamic Workflows for Scalable, Per-Tenant Durable Execution
Introduction
Cloudflare has unveiled a new open-source library called Dynamic Workflows, designed to bring flexibility to durable execution on its platform. Released under the MIT license, this library extends Cloudflare's durable execution engine to allow workflow code to vary per tenant, agent, or even per request at runtime. Built on the foundation of Dynamic Workers, it enables platforms to serve millions of unique durable workflows with near-zero idle cost. The headline use cases include CI/CD pipelines and agent plan execution. This article dives into what Dynamic Workflows are, how they work, and why they matter.

What Are Dynamic Workflows?
Dynamic Workflows is a library that enhances Cloudflare's durable execution capabilities. Durable execution allows developers to write long-running, fault-tolerant code that automatically retries on failure and persists state. Traditionally, workflows are static—once defined, they apply uniformly to all tenants or requests. Cloudflare's new library breaks that mold by enabling workflows that can be dynamically customized per tenant, agent, or request at runtime.
The Problem with Static Workflows
Static workflows work well for simple, one-size-fits-all scenarios. However, many platforms need to serve multiple tenants, each with unique business logic, compliance requirements, or execution configurations. With static workflows, developers end up duplicating code, using cumbersome feature flags, or building custom orchestration layers—all adding complexity and cost. Dynamic Workflows addresses this by allowing the workflow definition itself to change based on context.
How Dynamic Workflows Work
The library leverages Dynamic Workers to deliver per-request customization. Instead of a single workflow function, developers provide a router function that inspects the incoming request (including tenant ID, agent metadata, or other parameters) and returns the appropriate workflow code. This selection happens at runtime, and the chosen workflow then runs durably—meaning it can pause, wait for events, and resume without losing state. The result is a system where each tenant or agent can have its own workflow logic, yet all run on a shared, scalable infrastructure.
Built on Dynamic Workers
Dynamic Workflows is built on top of Cloudflare's Dynamic Workers, a feature that allows Worker code to be generated or selected dynamically at request time. Dynamic Workers already enable per-tenant or per-request JavaScript execution. The new library extends this concept to durable execution, combining the flexibility of dynamic code selection with the reliability of Cloudflare's Durable Objects and Workflows API. This combination means that even as workflows scale to millions of distinct variants, the underlying platform handles state persistence, retries, and concurrency automatically.
Key Features and Benefits
Per-Tenant Customization
The most significant benefit is per-tenant customization. SaaS platforms can now define separate workflow logic for each customer without needing separate deployments or complex branching. This is especially valuable for industries like finance, healthcare, or logistics, where each client has unique approval flows, data processing steps, or integrations.
Near-Zero Idle Cost
Cloudflare's serverless model means that workflows incur cost only when they are executing. Dynamic Workflows takes this further: idle workflows—those waiting for a timer, event, or callback—cost virtually nothing. Platforms can maintain millions of long-running, paused workflows without worrying about compute charges. This makes it economically feasible to support highly customized, long-running operations for every tenant.
/presentations/game-vr-flat-screens/en/smallimage/thumbnail-1775637585504.jpg)
MIT-Licensed Open Source
The library is released under the permissive MIT license, allowing developers to inspect, modify, and integrate it into their own projects. Cloudflare encourages community contributions to evolve the library. Being open source also means the code is transparent and auditable, which is crucial for security-conscious enterprises.
Use Cases
CI/CD Pipelines
Continuous Integration and Continuous Deployment (CI/CD) are natural fits for Dynamic Workflows. Each repository or team may need a slightly different pipeline: different build steps, testing suites, deployment targets, or approval gates. With Dynamic Workflows, a CI/CD platform can define a router that inspects the repository or branch and runs the appropriate durable workflow. This eliminates the need for template duplication or complex YAML branching. The workflow can also pause for manual approvals or external checks, then resume—all with built-in durability.
Agent Plan Execution
Another headline use case is agent plan execution. In AI or automation platforms, each agent may have a unique plan—a sequence of actions, decisions, and error handling. Dynamic Workflows allows each agent's plan to be defined as a distinct durable workflow. As agents proliferate (potentially millions), each one operates independently, with its own state and execution path. The near-zero idle cost ensures that running countless agents (each frequently pausing for input or time) remains affordable.
Conclusion
Cloudflare's Dynamic Workflows represents a significant step forward for durable execution in serverless environments. By enabling per-tenant, per-agent, per-request workflow customization without sacrificing scalability or cost efficiency, it empowers developers to build flexible, fault-tolerant systems. The MIT license and tight integration with Cloudflare Workers make it accessible and practical. Whether for CI/CD pipelines, agent orchestration, or any multi-tenant workload, Dynamic Workflows offers a compelling solution.
For more details, visit the official GitHub repository or refer to Cloudflare's documentation on Durable Objects and Workflows.
Related Articles
- Qualcomm XPAN Wi-Fi Audio: What’s Next for Wireless Sound?
- Android 17 QPR1 Beta 2: What Pixel Testers Need to Know
- GitHub Enhances Status Page with Fine-Grained Incident Reporting and Uptime Transparency
- Your Guide to Updating Rust and Understanding the 1.94.1 Point Release
- How to Apply Fred Brooks' Timeless Lessons from The Mythical Man-Month to Your Software Projects
- Windows 11 KB5083631 Optional Update: 34 Enhancements Including Xbox Mode and Batch File Security Boost
- Maximize Your Tax Refund Speed: Essential Tips for the 2022 Filing Season
- How Designers Can Make Accessibility a Natural Part of Their Workflow