Scheduled Jobs & Workflows
From in-process cron to durable Temporal workflows
Background
Payout jobs ran on in-process cron: no retries, no visibility into which tenant failed, and no way to resume a half-finished run.
Key Highlights
Multi-currency cashback and loyalty-bonus payouts credited to wallets over Kafka with unique order IDs
Temporal SDK, exponential-backoff retry policies and worker registry
Payout jobs rebuilt as parent workflows that fan out one child workflow per tenant, with a compensation step when publishing a credit fails
Daily segmentation reclassification with heartbeated, paginated activities
Guest-data cleanup as an idempotently created Temporal Schedule
Key Implementations
Parent/child workflows per tenant
A parent workflow lists tenants and starts one child workflow per tenant; each child pays out with unique order IDs and compensates if the publish fails.
Why: One tenant's failure no longer blocks the others, and each child can be retried and inspected on its own.
Technical Decisions
| Technical Decisions | Chosen | Alternative | Reason |
|---|---|---|---|
| Scheduler | Temporal | In-process cron with hand-written retries | Durable execution, retries with back-off, heartbeats and a UI for every run, without building them ourselves. |