Saga pattern (orchestration)
Orchestrator-coordinated saga with compensating actions for a multi-service order placement transaction.
The prompt
Saga orchestration pattern for placing an order across multiple services. An Order Saga Orchestrator service coordinates: 1) Reserve inventory (Inventory service), 2) Charge payment (Payment service), 3) Schedule shipping (Shipping service), 4) Send confirmation (Notification service). Each step publishes a success or failure event to Kafka. On failure at any step, the orchestrator triggers compensating actions in reverse order: refund payment, release inventory, cancel shipping. Show the orchestrator as a state machine with explicit states (Pending, InventoryReserved, PaymentCharged, ShippingScheduled, Completed, Compensating, Failed).
What it generates
A saga diagram showing the orchestrator's state machine, the participating services, and the success/compensation paths.
When to use it
When you need a distributed transaction across services without two-phase commit, especially when compensation logic is complex enough to centralise.
Generate this diagram in seconds
Copy the prompt above, sign in for free, and paste it into the generator.
Related microservices templates
API gateway with microservices
Edge API gateway routing to a microservice fleet with shared identity, async messaging, and per-service databases.
Event sourcing + CQRS
Event-sourced write side with append-only event store, plus separate read models materialised from event stream.
Strangler fig monolith migration
Gradual migration from monolith to microservices using an API gateway to route traffic to new services as they're built.