cloudflare-workflows

Orchestrate durable Cloudflare Workers tasks with retries and event waiting.

1|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/dotlab-hq/storage-platform --skill cloudflare-workflows-dotlab-hq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-workflows
Source: https://github.com/dotlab-hq/storage-platform/tree/main/.agents/skills/cloudflare-workflows
Command: npx skills add https://github.com/dotlab-hq/storage-platform --skill cloudflare-workflows-dotlab-hq

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Cloudflare Workers struggle to manage long-running tasks, retries, and complex orchestration across multiple steps. This skill provides a structured approach to building and operating durable Cloudflare Workflows with automatic retries, state persistence, eventing, and observability. It includes practical patterns, templates, and guidance to ship reliable, scalable workflows in production.

Core Features & Use Cases

  • Durable orchestration of multi-step tasks with automatic retries and backoff
  • Step primitives: step.do, step.sleep, step.sleepUntil, and step.waitForEvent
  • State persistence and observability for long-running processes
  • Quick-start templates and production patterns for error handling, retries, and testing

Quick Start

Scaffold a Cloudflare Workflow project, wire up a workflow binding, and run a simple example to see step.do in action.

Frequently Asked Questions about cloudflare-workflows

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I orchestrate long-running tasks in Cloudflare Workers with automatic retries?

You can orchestrate long-running tasks in Cloudflare Workers by building durable Cloudflare Workflows that use step.do for execution and automatic retries with backoff for reliable multi-step processing.

What is the best way to wait for an external event in a Cloudflare Worker before proceeding?

To wait for an external event in a Cloudflare Worker, use the step.waitForEvent primitive within your durable workflow to pause execution until the event is received, while state persistence maintains progress.

How do I handle terminal failures and prevent infinite retries in Cloudflare Workflows?

You can stop the automatic retry mechanism for terminal failures in Cloudflare Workflows by throwing a NonRetryableError, which immediately marks the step as permanently failed without attempting further executions.

Does Cloudflare Workflows support state persistence and delayed sleeps for batch jobs?

Yes, Cloudflare Workflows supports state persistence for batch jobs using step.sleep and step.sleepUntil primitives, allowing you to schedule delayed executions and maintain durable state across long-running processes.

How do I test Cloudflare Workflows in CI using Wrangler?

You can test Cloudflare Workflows in CI by integrating Wrangler testing commands into your pipeline, ensuring that workflow bindings and step execution logic function correctly before deploying to production.

Why do my Cloudflare Workflows fail when returning non-JSON-serializable outputs?

Cloudflare Workflows fail because they enforce JSON-serializable outputs for step.do results, ensuring that all state persistence and data passed between workflow steps can be reliably stored and retrieved.