Change8

@cloudflare/workflows-shared@0.11.0

📦 cloudflare-workersView on GitHub →
2 features🔧 1 symbols

Summary

This release introduces rollback support for local Workflows development, enabling steps to define compensation callbacks that execute upon workflow failure. Rollback configuration is passed via new options to `step.do`.

Migration Steps

  1. When using the new rollback options (`{ rollback }` or `{ rollback, rollbackConfig }`), note that these options only flow through when called through the StepPromise wrapper from a worker that has the `workerd`s `workflows_step_rollback` compat flag enabled, until that flag ships.

✨ New Features

  • Added rollback support for local Workflows development, allowing workflow steps to register a compensation callback using `step.do(name, fn, { rollback })` or `step.do(name, config, fn, { rollback, rollbackConfig })`.
  • Registered rollback callbacks are executed in reverse step-start order (LIFO) when a workflow fails, utilizing the existing retry/timeout machinery via an internal rollback-scoped `Context.do`.

Affected Symbols