Durable Workflows, Retries, and Compensation
A durable workflow persists progress so execution can resume after a process or infrastructure failure. Each step needs input/output state, timeout, retry classification, idempotency strategy, and compensation behavior where relevant.
A timeout may leave an external side effect in an unknown state. Query the external system or reuse an idempotency key before repeating the operation. Retry transient network failures differently from invalid input or permanent business rejection. Use bounded backoff with jitter.
Long-running workflows need cancellation rules, versioned definitions, operator intervention, and visibility into stuck states. Replaying a workflow after code changes must not reinterpret old state unsafely. Keep large payloads outside workflow history and reference them by stable identifiers.
- Persist progress and classify retryable errors.
- Timeouts can leave side effects ambiguous.
- Workflow replay and versioning need deliberate design.