rollback cancel order void mandate notify failure
1
💬
MIA (User)
User Intent
"Start a monthly SIP of 25,000 in PPFAS Flexi Cap" — Claude parses intent, extracts fund, amount, frequency
sip.intent.created
~2s (Claude SSE)
2
Advisory
Validate & Confirm
Risk-profile check, goal alignment validation, suitability score. MIA presents confirmation card with fund details
sip.validated
~0.5s
3
💳
Payments
Create Mandate
Razorpay UPI/eNACH mandate creation. Auto-debit authorization. Webhook confirmation
payment.mandate.created
~1s
4
🏦
Distribution
Register SIP @ MFU
MFU Central API call: SIP registration with CAN, fund ISIN, mandate reference. ISO-20022 message
sip.order.placed
~3s (MFU)
5
💼
Portfolio
Update Holdings
CQRS write: create pending SIP entry. Read model projection updates dashboard. XIRR recalculation scheduled
portfolio.sip.registered
~1s
6
🔔
Notifications
Confirm to User
Push notification + in-app MIA message: "SIP registered successfully." Email confirmation with SIP details
notification.sent
~0.5s
0sIntent
2sParsed
2.5sValidated
3.5sMandated
6.5sOrdered
7.5sRecorded
8sNotified
🤚
Biometric Gate
> 50K INR
User Confirm
via MIA card
Compensation Path (Saga Rollback)
Notifications
Send Failure Alert
Push + MIA message: "SIP could not be completed. Tap to retry."
notification.failure.sent
Payments
Void Mandate
Cancel Razorpay mandate if not yet executed. Refund if charged.
payment.mandate.voided
Distribution
Cancel MFU Order
Send cancellation to MFU Central. Idempotent — safe if order never reached MFU.
sip.order.cancelled
Portfolio
Revert Pending
Remove pending SIP entry from write model. Trigger read model re-projection.
portfolio.sip.reverted
8s
total budget
2s
Claude
+
0.5s
Advisory
+
1s
Payments
+
3s
MFU
+
1s
Portfolio
+
0.5s
Notify
Software Craftsman's Note
Saga Pattern with Choreography over Orchestration. Each service publishes domain events; downstream services react independently. No central coordinator = no single point of failure. Compensation is triggered by failure events, not rollback commands.
-- Microservices Patterns, Chris Richardson (2018)
Each Kafka topic uses Avro schemas with Schema Registry. Exactly-once delivery via idempotent producers + transactional outbox pattern. All events carry CorrelationId for distributed tracing (OpenTelemetry).
Happy path
Compensation
Kafka topic
Decision gate