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: Cloudflare
Latest Posts
- Workflows – Rollback support now available in Workflows
- OneDrive: Retention enforcement for unlicensed OneDrive accounts [MC1381110]
![OneDrive: Retention enforcement for unlicensed OneDrive accounts [MC1381110] 1 pexels goumbik 1414130](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- Microsoft Teams: Improved app and agent access request flows for admin‑blocked apps [MC1381120]
![Microsoft Teams: Improved app and agent access request flows for admin‑blocked apps [MC1381120] 2 pexels pixabay 162389](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
- (Updated) Upcoming change: disabling Teams meeting recording expiration notification emails [MC1245635]
![(Updated) Upcoming change: disabling Teams meeting recording expiration notification emails [MC1245635] 3 pexels pixabay 265087](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==)
![OneDrive: Retention enforcement for unlicensed OneDrive accounts [MC1381110] 1 pexels goumbik 1414130](https://mwpro.co.uk/wp-content/uploads/2024/08/pexels-goumbik-1414130-150x150.webp)
![Microsoft Teams: Improved app and agent access request flows for admin‑blocked apps [MC1381120] 2 pexels pixabay 162389](https://mwpro.co.uk/wp-content/uploads/2024/08/pexels-pixabay-162389-150x150.webp)
![(Updated) Upcoming change: disabling Teams meeting recording expiration notification emails [MC1245635] 3 pexels pixabay 265087](https://mwpro.co.uk/wp-content/uploads/2024/08/pexels-pixabay-265087-150x150.webp)