The Zero-Pipeline Deploy: Inside dynamic-workers-rollout-demo

How Eric Clemmons combined Cloudflare Dynamic Workers and Key-Value storage to turn infrastructure rollouts into instant database writes.

7 min read • View on GitHub • More from ericclemmons

A slow conveyor belt of heavy boxes bypassed by a sleek pneumatic tube shooting capsules directly into a hub.
Bypassing the traditional CI/CD conveyor belt to inject code directly into the edge.
Key Takeaways

Bypassing the CI/CD Conveyor Belt

Modern deployment pipelines are a miracle of automation, but they are undeniably slow. Even the fastest edge networks require build steps, packaging, and global propagation time. Operations teams wait minutes for a simple rollback to take effect.

The dynamic-workers-rollout-demo offers a radical alternative. Built by Eric Clemmons, it bypasses the build pipeline entirely by treating infrastructure as dynamically loaded data. It shifts the paradigm from pushing code to pulling state.

You can now have a Worker spin up other Workers, called Dynamic Workers, at runtime to execute code on-demand in a secure, sandboxed environment.

Cloudflare Changelog, Official Product Update · Dynamic Workers, now in open beta

Code as Data in the KV Store

The architecture centers on a single, stable Gateway worker. Instead of containing application logic, this Gateway looks up raw JavaScript strings stored in a Cloudflare KV namespace. It executes them on the fly.

Writing a new string to the KV store instantly deploys a new version. The database becomes the deployment target.

The Gateway worker dynamically loads code from Key-Value storage, bypassing traditional deployment pipelines.

The Globally Consistent Crossfader

Naive KV rollouts suffer from eventual consistency. If a developer slides a traffic dial to 10 percent, propagation delays cause traffic flickering for users across different regions.

To solve this, the project uses a Durable Object as a stateful crossfader. This ensures a canary rollout is mathematically consistent globally. Specific user IDs are deterministically hashed to the correct version.

A close-up of a DJ mixer crossfader locked firmly in place by heavy mechanical gears.
Durable Objects act as a mechanical lock, ensuring globally consistent traffic routing.
export class RolloutConfig extends DurableObject {
  async fetch(request: Request) {
    // Block concurrency until state is fully loaded
    await this.ctx.blockConcurrencyWhile(async () => {
      this.state = await this.ctx.storage.get('config');
    });
    return new Response(JSON.stringify(this.state));
  }
}

Synchronous Stubbing at the Edge

The magic happens through the env.LOADER.get() API. The Gateway initiates multiple worker fetches in parallel, such as an API worker and a Layout worker.

Because these execute in the same edge isolate or a warm neighbor, it achieves micro-service composition without network overhead. The Gateway does not wait for KV fetch completion before executing the next line of code.

The Control Plane Trade-off

This custom routing pattern offers immense power, but it competes with native platform primitives. Teams must weigh the flexibility of a custom Gateway against the operational simplicity of built-in tools.

FeatureCustom Gateway (This Repo)Native Gradual Deployments
Traffic ControlCustom logic (User ID, Headers)Percentage split only
State ManagementDurable Objects & KVNative Platform Invisible
Target Use CaseDynamic Micro-frontendsStandard API Rollouts
ComplexityHigh (Requires custom code)Low (Dashboard toggle)