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.

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