Skip to content

Changelog

New updates and improvements at Cloudflare.

hero image

Rollback support now available in Workflows

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",
},
},
);

Refer to rollback options to learn more.