Skip to main content

Cloudflare Workflows Example

This example demonstrates using Cloudflare Workflows for stateful, long-running processes. The workflow example is included in the comprehensive Cloudflare Worker example.

Features

  • Workflows: Stateful workflow orchestration
  • OFAC Processing: Example compliance workflow
  • Worker Integration: Workflows bound to Workers
  • Durable Execution: Guaranteed workflow completion

Project Setup

Key Features Explained

Workflow Definition

Workflows are defined with a class name and workflow name:

Workflow Steps

Steps provide durability guarantees:

Sleep/Delays

Workflows can pause execution:

Instance Management

Create and manage workflow instances:

Use Cases

  • Compliance workflows (OFAC, KYC)
  • Multi-step approval processes
  • Long-running data processing
  • Saga pattern implementations
  • Retry-able operations with state

Source Code

View the complete source code: examples/cloudflare-worker