---
title: Workflows rollback handlers now include step context
description: Workflows rollback handlers now receive the original step context, and rollbackConfig is limited to retry and timeout settings.
image: https://edgetunnel-b2h.pages.dev/changelog-preview.png
---

> Documentation Index  
> Fetch the complete documentation index at: https://edgetunnel-b2h.pages.dev/changelog/llms.txt  
> Use this file to discover all available pages before exploring further. 

[Skip to content](#%5Ftop) 

# Changelog

New updates and improvements at Cloudflare.

[ Subscribe to RSS ](https://edgetunnel-b2h.pages.dev/changelog/rss/index.xml) [ View RSS feeds ](https://edgetunnel-b2h.pages.dev/fundamentals/new-features/available-rss-feeds/) 

![hero image](https://edgetunnel-b2h.pages.dev/_astro/hero.CVYJHPAd_26AMqX.svg) 

[ ← Back to all posts ](https://edgetunnel-b2h.pages.dev/changelog/) 

## Workflows rollback handlers now include step context

Jun 23, 2026 

[ Workflows ](https://edgetunnel-b2h.pages.dev/workflows/) 

[Workflows](https://edgetunnel-b2h.pages.dev/workflows/) makes it easier to build reliable multi-step applications that can recover when downstream systems fail. Rollback handlers now receive the original [step context](https://edgetunnel-b2h.pages.dev/workflows/build/step-context/) via a `ctx` object for the step being rolled back. This includes `ctx.step.name`, `ctx.step.count`, `ctx.attempt`, and the step `config` with defaults applied.

The [step configuration](https://edgetunnel-b2h.pages.dev/workflows/build/workers-api/#workflowstepconfig) includes the retry and timeout settings used for that step, so you can customize your step recovery logic according to those fields.

**TypeScript**

```ts
await step.do(
  "create charge",
  async () => {
    const charge = await createCharge();
    return { chargeId: charge.id };
  },
  {
    rollback: async ({ ctx, output, error }) => {
      // `output` is the value returned by the step being rolled back.
      const { chargeId } = output as { chargeId: string };
      await refundCharge(chargeId, {
        // `ctx` is the original step context, including step name, count, attempt, and config.
        reason: `${ctx.step.name}: ${error.message}`,
      });
    },
    rollbackConfig: {
      // `rollbackConfig` controls retries and timeout for the rollback handler.
      retries: { limit: 3, delay: "30 seconds", backoff: "linear" },
      timeout: "5 minutes",
    },
  },
);
```

Refer to [rollback options](https://edgetunnel-b2h.pages.dev/workflows/build/workers-api/#rollback-options) to learn more.

```json
{"@context":"https://schema.org","@type":"BlogPosting","@id":"https://edgetunnel-b2h.pages.dev/changelog/post/2026-06-16-rollback-options/#page","headline":"Workflows rollback handlers now include step context · Changelog","description":"Workflows rollback handlers now receive the original step context, and rollbackConfig is limited to retry and timeout settings.","url":"https://edgetunnel-b2h.pages.dev/changelog/post/2026-06-16-rollback-options/","inLanguage":"en","image":"https://edgetunnel-b2h.pages.dev/changelog-preview.png","dateModified":"2026-06-23","datePublished":"2026-06-23","publisher":{"@type":"Organization","name":"Cloudflare","url":"https://www.cloudflare.com/"},"isPartOf":{"@type":"WebSite","@id":"https://edgetunnel-b2h.pages.dev/#website","name":"Cloudflare Docs","url":"https://edgetunnel-b2h.pages.dev/"}}
```
