Skip to main content

Module rollback

Module rollback 

Source
Expand description

Rollback engine for workflow failure recovery using Saga compensation pattern.

The rollback engine provides selective rollback of dependent tasks using DAG backward traversal. When a task fails, only its dependents are rolled back, leaving independent tasks in their completed state.

§Saga Compensation Pattern

Rollback uses the Saga pattern where each task optionally provides a compensation action that undoes its side effects:

  • UndoFunction: Executes a compensating transaction (e.g., delete created file)
  • Skip: No compensation needed (read-only operations like queries)
  • Retry: Recommends retry instead of compensation (transient failures)

§Rollback Strategies

  • AllDependent: Roll back all tasks reachable from failed task (default)
  • FailedOnly: Roll back only the failed task
  • Custom: Use provided filter function for selective rollback

Structs§

CompensationRegistry
Registry for tracking compensation actions for workflow tasks.
CompensationReport
Report from compensation coverage validation.
ExecutableCompensation
Extended compensation action with undo function support.
RollbackEngine
Rollback engine for workflow failure recovery.
RollbackReport
Report from rollback execution.
ToolCompensation
Compensation action for external tool side effects.

Enums§

RollbackError
Errors that can occur during rollback.
RollbackStrategy
Rollback strategy for determining which tasks to roll back.