Skip to content

Feature: Saga/Compensation Pattern for Rollback on Failure #14

Description

@benrowe

Description

Implement saga/compensation pattern to support rollback when actions fail mid-workflow.

Acceptance Criteria

Given 3 actions where action 2 fails
And each action can be compensated/rolled back
When action 2 throws an exception
Then action 1's rollback should execute
And the state should be restored

Technical Notes

  • This requires a compensation/saga pattern
  • Actions would need to implement a Compensable interface with a compensate() method
  • StateWorker would need to track executed actions and run compensations in reverse order on failure

Related

  • Original scenario: 13.3 from acceptance-tests.md
  • Priority: Low (advanced feature)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions