Effect Saga Orchestrator
The pattern for a multi-vendor booking that fails halfway and must not keep your money. Charge the card, reserve the seat, issue the ticket: if the ticket service is down after the charge, a plain sequence leaves the customer charged for a seat they cannot use. There is no distributed transaction across three vendors' APIs, so the saga registers each step's compensation as it succeeds and, on failure, runs the compensations in reverse for exactly the steps that completed. A compensation that itself fails surfaces as a typed CompensationFailed carrying the stuck steps, not a swallowed refund. The demo unwinds a charge and a seat reservation cleanly when ticketing fails. Pinned to effect 4.0.0-beta.98.
npx shadcn@latest add https://ui.aryank.space/r/effect-saga-payment-orchestrator.jsonInstalls from ui.aryank.space. To add it by hand, copy the files in Files below, or register the @compronents namespace via the docs.
Charge, reserve, issue: each forward step registers its compensation. Ticketing fails, so the saga runs the compensations in reverse for exactly the steps that succeeded. Card refunded, seat released, nothing stranded.