Skip to content

Process 05 — payment-saga happy path

Successful flow: auction closes → top bidder’s saved card charges first try (no 3DS) → invoice issued → ad activates at T+24h.

Auction close starts the payment workflow for the leading bidder. The workflow creates and finalizes an invoice, retains its PDF, pays it and waits for a verified success webhook. It then activates the scheduled Spotlight and notifies the advertiser.Auction close starts the payment workflow for the leading bidder. The workflow creates and finalizes an invoice, retains its PDF, pays it and waits for a verified success webhook. It then activates the scheduled Spotlight and notifies the advertiser.

Key invariants on the happy path

  • instance_id is exactly auction_id throughout.
  • Every Stripe call has Idempotency-Key: ${saga_instance_id}:${step}:${attempt} with attempt=1.
  • The webhook bridge only signals; it does not write to D1.
  • invoices.retrieve is called at the top of the post-event step to guard against the bridge having lost the payload.
  • Total wall-clock on a fully successful run: dominated by step.sleepUntil(T+24h); CPU work is < 5s.