SYSTEM Cited by 2 sources
Cloudflare Workflows¶
Workflows is Cloudflare's
durable-execution primitive for long-running, retriable,
step-checkpointed workflows built on
Workers
(developers.cloudflare.com/workflows).
Think: background jobs that span hours or days, steps retry
independently, state persists across step boundaries.
Role¶
- Long-running orchestration without keeping a Worker hot.
- Per-step retry / checkpoint semantics.
- Complements Durable Objects for coordination and state.
Programming model¶
A Workflow is a class extending WorkflowEntrypoint with an
async run(event, step) method. Every side-effecting action is
wrapped in step.do('name', async () => {...}) so each step
survives failures independently, resumes exactly where it left
off, and is checkpointed durably before advancing.
import { WorkflowEntrypoint } from 'cloudflare:workers';
export class MyWorkflow extends WorkflowEntrypoint {
async run(event, step) {
const a = await step.do('first', async () => doA());
await step.sleep('24 hours');
await step.waitForEvent('approval', { timeout: '24 hours' });
return step.do('second', async () => doB(a));
}
}
step.do()— retryable checkpointed step.step.sleep()— hibernates; no VM held open during the wait.step.waitForEvent()— indefinite wait for an external event (approval, webhook, timer)..create()/.status()/.pause()— instance-level APIs on the Workflow binding.
Registered in wrangler.jsonc:
One binding → one class_name → one deploy. Statically bound.
Canonicalised in
patterns/workflow-primitives-as-annotated-classes.
Workflows V2 capacity (2026-05-01 disclosure)¶
Workflows V2 is "redesigned for the agentic era" — per-account limits as disclosed in the 2026-05-01 Dynamic Workflows launch:
- Up to 50,000 concurrent workflow instances per account.
- Up to 300 new instances per second per account.
These are ambient capacity context for platforms running per- tenant workflows at fleet scale. First wiki disclosure of the V2 capacity envelope. (Source: Dynamic Workflows.)
Dynamic dispatch via Dynamic Workflows (2026-05-01)¶
The static one-class-per-deploy binding was the last missing
piece for multi-tenant platforms — app platforms where the AI
writes TypeScript per tenant, CI/CD products where each repo has
its own pipeline, agents SDKs where each agent writes its own
durable plan.
@cloudflare/dynamic-workflows
(2026-05-01) lifts the constraint: a single Worker Loader routes
every create() call and every subsequent run(event, step)
invocation into the right tenant's code, loaded as a
Dynamic Worker at runtime. The
Workflows engine's durability machinery (IDs, step.sleep(),
step.waitForEvent(), retries, hibernation) continues to work
unchanged — "everything else falls through to the real Workflows
engine untouched."
Canonicalised in:
- systems/cloudflare-dynamic-workflows — the library.
- concepts/per-tenant-dynamic-code-dispatch — the general three-layer dispatch shape (engine / Worker Loader / tenant code).
- patterns/metadata-envelope-in-durable-payload — the wire-format trick that threads tenant ID through the persisted payload so the engine can replay into the right tenant's code.
- patterns/dynamic-binding-over-static-binding — the general platform-design shape of which Dynamic Workflows is the durable-execution instance.
Local / remote parity¶
Workflows are among the binding types introspectable via
Local Explorer's local
mirror API at /cdn-cgi/explorer/api, backed by
Miniflare (Source:
sources/2026-04-13-cloudflare-building-a-cli-for-all-of-cloudflare).
Seen in¶
- sources/2026-04-13-cloudflare-building-a-cli-for-all-of-cloudflare — Workflows is one of the introspectable binding types in Local Explorer.
- sources/2026-05-01-cloudflare-introducing-dynamic-workflows-durable-execution-that-follows-the-tenant — Workflows V2 capacity envelope disclosed; Dynamic Workflows bridges Workflows with Dynamic Workers for multi-tenant dispatch; engine is left unchanged and additive wrapper glue handles routing.
- sources/2026-05-28-cloudflare-how-we-built-cloudflares-data-platform-and-an-ai-agent-on-top-of-it — Workflows is the execution substrate for Transformer, Town Lake's ELT engine. Pipelines are YAML-frontmatter-defined SQL DAGs; Transformer compiles the DAG and runs it on Workflows, with per-DAG state managed by Durable Objects, definitions stored in R2, and run history in D1. Canonicalises patterns/elt-on-workflows-with-do-state — sibling to the existing CI pipeline shape: same architectural pattern (customer-authored YAML, Workflow execution, DO state) applied to a different domain (data engineering, not CI).
Related¶
- systems/cloudflare-workers
- systems/cloudflare-durable-objects
- systems/cloudflare-dynamic-workflows
- systems/dynamic-workers
- systems/miniflare
- systems/cloudflare-local-explorer
- systems/wrangler-cli
- systems/project-think
- systems/cloudflare-transformer-elt — second major customer-authored-DAG instance: Town Lake's ELT engine.
- systems/cloudflare-town-lake — the data platform consuming Workflows for Transformer execution.
- concepts/durable-execution
- concepts/per-tenant-dynamic-code-dispatch
- patterns/workflow-primitives-as-annotated-classes
- patterns/dynamic-binding-over-static-binding
- patterns/metadata-envelope-in-durable-payload
- patterns/elt-on-workflows-with-do-state — Town Lake's Transformer canonical pattern.
- companies/cloudflare