Workflows

Build durable multi-step applications.

Workflows is an execution engine built on Cloudflare Workers — to build applications that can automatically retry, persist state and run for minutes, hours, days, or weeks. Workflows introduces a programming model that makes it easier to build reliable, long-running tasks, observe progression, and programmatically trigger events-based instances based across your services.
Step-based
Step-based

Any logic wrapped in a step can be automatically retried and memoized for durability.

State included
State included

Every instance persists to its own local state: no need to set up or manage a database or control plane.

Human-in-the-loop
Human-in-the-loop

Wait on external events: webhooks, approvals, queue messages — you name it.

Proven workflow infrastructure, powering products at scale

The same end-to-end workflow stack behind Cloudflare's own products — battle-tested across billions of requests and millions of users daily. Build with the same primitives we use in production.

Background Pattern
Workflows

Use Workflows to Power

Build applications that need to be reliable and long-running everywhere.

Building AI agents

Code review tasks, compact context, or processing data

Asynchronous tasks

Lifecycle emails, billing jobs, and critical data processing tasks

Post-processing user-generated content

Run inference, clean up or validate uploaded content

Durable building blocks

Everything you need to build, deploy, and scale durable multi-step applications on Cloudflare's global infrastructure.

Step-based execution

Any logic wrapped in a step can be automatically retried and memoized for durability.

Built-in state management

Every instance persists to its own local state: no need to set up or manage a database or control plane.

Human-in-the-loop

Wait on external events: webhooks, approvals, queue messages — you name it.

Automatic retries

Built-in retry logic with exponential backoff and configurable retry policies for resilient execution.

Observability included

Built-in logging, metrics, and tracing to monitor workflow execution and debug issues.

Event-driven triggers

Programmatically trigger workflow instances based on events across your services.

Scale-to-zero pricing

Pay only for the CPU cycles your workflows actually use — idle workflows cost nothing.

Everything you need to automate

Deploy durable multi-step applications between meetings.

Background Pattern
import { WorkflowEntrypoint } from "cloudflare:workers";

export class DataProcessingWorkflow extends WorkflowEntrypoint {
  async run(event, step) {
    // This step will be automatically retried on failure
    const result = await step.do("processData", async () => {
      const input = event.payload.data;
      return input;
    });

    // Another step that can be retried independently
    await step.do("transform", async () => {
      return result.map((item) => ({ ...item, processed: true }));
    });
  }
}

Step-based execution included

Any logic wrapped in a step can be automatically retried and memoized for durability with zero configuration.

State management for zero config

Automatically persist workflow state without setting up databases or control planes

Event-driven architecture

Built on Workers to provide an out of the box event-driven layer, with global distribution included

Build with durable workflows

Deploy long-running applications with zero infrastructure overhead — designed to scale globally and handle complex multi-step processes automatically.

Background Pattern
npm create cloudflare@latest my-workflow
Read-only

Durable by design

Your workflows run at the edge in 330+ cities worldwide — with D1 databases, KV storage, and R2 object storage available for state management.

Event-driven ready

Deploy both workflows and triggers together — from webhooks to queue messages, all with automatic retry and state management.

Observable by default

Built-in logging, metrics, and tracing help you monitor and debug workflow execution.
Clonable

Cloneable is in the field of very heavy data collection, and we need a reliable provider who can sync data while users are working out in more isolated places. Not having to worry about latency from a bucket across the country and the egress costs, allows us/our customers to focus on what really matters: getting the data.

Cloudflare powers
1 in 5 sites on the Internet

Trusted by the teams you trust. And thousands more...

Powerful primitives, seamlessly integrated

Built on systems powering 20% of the Internet, Workflows run on the same infrastructure Cloudflare uses to build Cloudflare. Enterprise-grade reliability, security, and performance are standard.

Build without boundaries

Join thousands of developers who've eliminated infrastructure complexity and deployed globally with Cloudflare. Start building for free — no credit card required.