Module rollback

Module rollback 

Source
Expand description

Execution rollback mechanism for workflows

This module provides the ability to create snapshots of execution state and rollback to previous states when needed.

§Features

  • Create point-in-time snapshots of execution state
  • Store execution history with automatic pruning
  • Rollback to any previous snapshot
  • Support for selective rollback (specific variables, node results)

§Example

use oxify_model::rollback::{ExecutionSnapshot, RollbackManager};
use oxify_model::execution::ExecutionContext;
use uuid::Uuid;

let mut manager = RollbackManager::new(10); // Keep 10 snapshots max
let mut context = ExecutionContext::new(Uuid::new_v4());

// Create a snapshot before risky operation
let snapshot = ExecutionSnapshot::from_context(&context);
manager.push_snapshot(snapshot);

// If operation fails, rollback
let result = manager.rollback(&mut context);
assert!(result.success);

Structs§

ExecutionSnapshot
A point-in-time snapshot of execution state
RollbackManager
Manages execution snapshots and rollback operations
RollbackResult
Result of a rollback operation
RollbackSummary
Summary of rollback manager state
SnapshotMetadata
Metadata about a snapshot