Skip to content

Error Handling

Workflows should explicitly model retries, failure branches, and compensation.

Failure Strategy Building Blocks

  • Retry for transient errors.
  • Branch on response/status conditions.
  • Compensation steps for partial side-effect rollback.
  • Terminal cancel/fail paths for unrecoverable cases.
  1. Classify expected error types.
  2. Retry only transient dependency failures.
  3. Add compensation where external state is mutated.
  4. Emit clear logs and trace context for failed paths.

Validation

  • Run failure-path test payloads.
  • Verify expected retry and compensation behavior in traces.