Enterprise agent workflows routinely span heterogeneous systems—SAP Inventory ATP, Procurement Purchase Orders, Freight Carrier APIs, and SWIFT/SEPA Treasury Gateways. Holding distributed XA / Two-Phase Commit (2PC) database locks across multi-hundred-millisecond REST/MCP calls or human dual-control pauses causes severe lock contention, head-of-line blocking, and is unsupported by most external SaaS/ERP APIs.
We adopted Orchestrated Sagas (src/aegis/saga/coordinator.py) with four hard engineering guarantees:
IdempotencyStore): Every step derives idem_<sha256> over (tenant_id, workflow_id, step_name, tool_name, sanitized_params), ensuring transient HTTP 503 retries never double-deduct inventory or double-encumber budgets.BLOCKED_BY_POLICY._usd_to_cents) rather than IEEE-754 float accumulation, guaranteeing exact zero-drift conservation (available + encumbered + settled == initial_allocation).QUARANTINED Terminal State: If a compensating action itself exhausts bounded retries, the coordinator transitions the workflow to QUARANTINED and logs SAGA_COMPENSATION_FAILED rather than silently masking orphaned state.0 orphan mutations under 25% chaos fault injection.ENCUMBERED / RESERVED prior to compensation, requiring explicit reservation semantics in ERP tables).