Workflows - Rollback support now available
Workflows now supports saga-style rollbacks with compensating logic for each step, executing in reverse order if failures occur. This enables safer multi-step operations across external systems, with dedicated retry and timeout configuration for rollback handlers, plus analytics events for easier debugging.
Workflows now supports saga-style rollbacks, allowing you to add compensating logic to each step.do() in case of downstream failures. If the instance fails, the rollback handlers will execute in reverse step-start order.
This is useful for multi-step operations that touch external systems, such as inventory reservations, payment authorization, ticket creation, or infrastructure provisioning. Instead of writing all cleanup logic in a top-level catch, you can keep each compensating action next to the step it undoes.
Rollback handlers support their own retry and timeout configuration, and Workflows now exposes rollback outcomes in instance status responses. Workflows analytics also emits rollback lifecycle events, making it easier to distinguish a forward execution failure from a rollback failure when debugging production workflows.
JavaScript
await step.do( "provision resource", async () => { const resource = await provisionResource(); return { resourceId: resource.id }; }, { rollback: async ({ output }) => { const { resourceId } = output; await deleteResource(resourceId); }, rollbackConfig: { retries: { limit: 3, delay: "15 seconds", backoff: "linear" }, timeout: "2 minutes", }, },);TypeScript
await step.do( "provision resource", async () => { const resource = await provisionResource(); return { resourceId: resource.id }; }, { rollback: async ({ output }) => { const { resourceId } = output as { resourceId: string }; await deleteResource(resourceId); }, rollbackConfig: { retries: { limit: 3, delay: "15 seconds", backoff: "linear" }, timeout: "2 minutes", }, },);
Refer to rollback options to learn more.
Source: original entry ↗
More from Cloudflare
Follow Cloudflare to get its new changes in your feed and email digest.
Cloudflare One Client for Windows hotfix - trusted certificate chains
A new GA release for Windows Cloudflare One Client is available, addressing an issue with building trusted certificate chains.
Cloudflare One Client for macOS - Trusted Certificate Chain Fix
A new GA release of the macOS Cloudflare One Client is available. This hotfix addresses an issue with building trusted certificate chains.
Cloudflare One Client for Linux
A new GA release of Cloudflare One Client for Linux is now available. This hotfix addresses an issue with building trusted certificate chains.