Cloudflare Workflows

Last updated Sep 18, 2026 Build durable multi-step applications on Cloudflare Workers with Workflows.

Available on Free and Paid plans

With Workflows, you can build applications that chain together multiple steps, automatically retry failed tasks, and persist state for minutes, hours, or even weeks - with no infrastructure to manage.

Use Workflows to build reliable AI applications, process data pipelines, manage user lifecycle with automated emails and trial expirations, and implement human-in-the-loop approval systems.

Workflows give you:

  • Durable multi-step execution without timeouts
  • The ability to pause for external events or approvals
  • Automatic retries and error handling
  • Built-in observability and debugging

Example

An image processing workflow that fetches from R2, generates an AI description, waits for approval, then publishes:

export class ImageProcessingWorkflow extends WorkflowEntrypoint {
    async run(event: WorkflowEvent, step: WorkflowStep) {
        const imageData = await step.do('fetch image', async () => {
            const object = await this.env.BUCKET.get(event.payload.imageKey);
            return await object.arrayBuffer();
        });

        const description = await step.do('generate description', async () => {
            const imageArray = Array.from(new Uint8Array(imageData));
            return await this.env.AI.run('@cf/llava-hf/llava-1.5-7b-hf', {
                image: imageArray,
                prompt: 'Describe this image in one sentence',
                max_tokens: 50,
            });
        });

        await step.waitForEvent('await approval', {
            event: 'approved',
            timeout: '24 hours',
        });

        await step.do('publish', async () => {
            await this.env.BUCKET.put(`public/${event.payload.imageKey}`, imageData);
        });
    }
}

Get started Browse the examples


Features

Durable step execution

Break complex operations into durable steps with automatic retries and error handling.

Learn about steps

Sleep and scheduling

Pause workflows for seconds, hours, or days with step.sleep() and step.sleepUntil().

Add delays

Wait for external events

Wait for webhooks, user input, or external system responses before continuing execution.

Handle events

Workflow lifecycle management

Trigger, pause, resume, and terminate workflow instances programmatically or via API.

Manage instances


Workers

Build serverless applications and deploy instantly across the globe for exceptional performance, reliability, and scale.

Pages

Deploy dynamic front-end applications in record time.


More resources

Pricing

Learn more about how Workflows is priced.

Limits

Learn more about Workflow limits, and how to work within them.

Storage options

Learn more about the storage and database options you can build on with Workers.

Developer Discord

Connect with the Workers community on Discord to ask questions, show what you are building, and discuss the platform with other developers.

@CloudflareDev

Follow @CloudflareDev on Twitter to learn about product announcements, and what is new in Cloudflare Developer Platform.

Was this helpful?

YesNo

On this page

Cloudflare Workflows - 图1Docs

{"@context":"https://schema.org","@type":"WebPage","@id":"https://developers.cloudflare.com/workflows/#page","headline":"Cloudflare Workflows","description":"Build durable, multi-step applications on Cloudflare Workers that automatically retry and persist state.","url":"https://developers.cloudflare.com/workflows/","inLanguage":"en","image":"https://developers.cloudflare.com/workflows/og.png?v=54a0a1b5a3c2e37f","dateModified":"2026-09-18","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Control reading and writing from the Cloudflare global network cache. title: Cache image: https://developers.cloudflare.com/workers/runtime-apis/cache/og.png?v=89dcc60196ea13c5


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/workers/llms.txt
Use this file to discover all available pages before exploring further.