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

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

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

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

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.

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
Background Pattern

Durable by design