What is idempotency? And why it matters for durable systems
Feb 27, 2024

Summary
This post introduces the concept of idempotency and its importance in durable execution systems like Temporal. It explains how to achieve idempotency in Temporal Activities using idempotency keys (e.g., `workflowRunId + '-' + activityId` or natural keys from external systems) and by checking for pre-existing results. It also provides a SQL example for preventing duplicate side effects and discusses potential race conditions when checking for existing state. The post emphasizes Temporal's 'at least once' execution guarantee for Activities and recommends making Activities idempotent to handle retries safely.