Problem: RabbitMQ messages acked before processing completed were lost on crash. Reprocessing from step 1 triggered redundant third-party enrichment API calls at $0.04 each — adding ~$600/day in unnecessary cost.
Solution: Migrated each claim to a Temporal workflow with 6 activities. Temporal persisted state after every activity, so a crash resumed from the last successful step. Activity retry policies used idempotency tokens for the enrichment API call to prevent double-billing. Migration ran in parallel — 5% of traffic to Temporal, scaling to 100% over 2 weeks after parity validation.
Technology: Temporal · Go · Postgres · RabbitMQ (retired) · Docker
Optimisation pattern: stateless-queue-to-durable-workflow-with-activity-checkpointing
Outcomes:
Zero claims lost on worker failure since migration (vs ~12/day). Third-party enrichment API costs reduced 34%. New activity (regulatory reporting) added in one afternoon with zero pipeline downtime. Step-level observability in Temporal UI replaced a custom maintenance-burden dashboard.