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.
Recommended Approach¶
- Classify expected error types.
- Retry only transient dependency failures.
- Add compensation where external state is mutated.
- Emit clear logs and trace context for failed paths.
Validation¶
- Run failure-path test payloads.
- Verify expected retry and compensation behavior in traces.