Interview preparation
Advanced·Discussion·2 min read

How do I explain workflow state, retries and compensation?

Practice this question
Discussion template: use your own project facts, ownership, and measured outcomes. Bracketed text is a placeholder.

Short explanation:

Workflow state records where a run is, which steps completed and what remains to be done. Retries repeat recoverable steps, while compensation performs a business recovery action after partial success. Durable state makes these decisions possible after a process restart instead of relying on in-memory progress.

Key points:

  • Store each run's current step, status and attempt history durably.

  • Retry temporary failures safely; stable operation IDs help prevent duplicate effects.

  • Compensation is a business action to recover from partial success, such as releasing a reservation.

  • Use stable run/step IDs and distinguish a failed step from a step whose remote result is still unknown.

Interview point:

  • Explain the exact recovery decision after a crash between an external action and saving its local completion status.
Adapted from 10_RESUME_PROJECT_DEEP_DIVE.md · “How do I explain workflow state, retries and compensation?”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.