#345 Demo: Distributed Transaction Saga (E-commerce)

wont-do medium demo workflow Created 2025-12-10 06:39 · Updated 2025-12-10 19:04

Description

Edit
## update: this will complicate the maintenance. this is not a feature we want to have intentionality. ## Overview Cross-microservice transactions using Saga pattern with compensation. ## Workflow Steps 1. Reserve Inventory (Service A) 2. Charge Payment (Service B) 3. Allocate Shipping (Service C) ## Compensation Logic - If Charge Payment fails: Execute Release Inventory - If Allocate Shipping fails: Refund Payment + Release Inventory ## Tools Required - tools.http.request ✅ (microservice calls) - Error handling ✅ (native try/catch equivalent) ## DSL Operators TaskOperator, ErrorHandler (compensation), ConditionalOperator ## Mock Implementation - 3 mock microservice endpoints - Configurable failure points - Compensation endpoints for rollback ## Durable Advantages - Guaranteed data consistency - Automatic compensation on failure - No two-phase commit needed - Full audit trail ## Sample Workflow Structure ``` reserve_inventory → charge_payment → allocate_shipping ↓ (on failure) release_inventory ```

Comments

Loading comments...

Context

Loading context...

Audit History

View All
Loading audit history...