Minor Changes
-
#13983
9803586Thanks @vaishnav-mk! - Add rollback support for local Workflows developmentWorkflow steps can now register a compensation callback with trailing rollback options:
step.do(name, fn, { rollback })andstep.do(name, config, fn, { rollback, rollbackConfig }). When the workflow fails, the local engine runs every registered rollback in reverse step-start order (LIFO), giving steps the opportunity to undo their side effects.Each rollback executes through an internal rollback-scoped
Context.do, so it inherits the existing retry / timeout / attempt-tracking machinery.rollbackConfiglets users override the per-rollback config.Note: the public rollback option type lands with workerd's
workflows_step_rollbackcompat flag. Until that ships, the trailing rollback options only flow through when called through the StepPromise wrapper from a worker that has the flag enabled.