WorkflowFailure: why a step’s most recent attempt failed. It’s on every step outcome (run.steps[i].failure), both while the step can still be retried and once it can’t.WorkflowSessionFailure: why a run ended without being submitted. It’s onrun.sessionFailure.
What the SDK does for you
InDeepIDVWorkflowView, a failed attempt with attempts left shows a retry screen and redoes only what failed:

A retry with attempts left.
WorkflowFailure
WorkflowSessionFailure
Rules for robust code
- Codes are open sets.
WorkflowFailure.Code,WorkflowSessionFailure.CodeandAPIErrorCodeare structs, not enums. A newer server can send a code this SDK version doesn’t know; it arrives inrawValue. Always keep adefaultbranch. - Prefer
categoryanduserActionfor decisions. They’re small and stable. - Don’t show
messageto users. Write your own copy fromcodeoruserAction. - Scores and thresholds aren’t exposed to the app.