# Saga Compensation Diagrams This document contains PlantUML diagrams describing the saga compensation mechanism in the Floxy library. ## Sequence Diagram Shows the step-by-step execution of the compensation process:
Saga Compensation Sequence
## State Diagram Shows the transitions between step states:
Saga Compensation State Machine
## Architecture Diagram Shows system components and their interactions:
Saga Compensation Architecture
## Key Features ### Separate Retry Counters - `RetryCount` - for normal step execution attempts - `CompensationRetryCount` - for compensation attempts ### Step Statuses - `StepStatusCompensation` - step is being compensated - `StepStatusRolledBack` - step successfully rolled back - `StepStatusFailed` - compensation exhausted all attempts ### Compensation Logic 1. On step failure, rollback process is initiated 2. If OnFailure handler exists, step is marked as Compensation 3. Compensation executes with retry logic 4. On success, step is marked as RolledBack 5. On failure - retry attempt or final Failed status