Quick Start
How It Works
| Component | Role |
|---|---|
| WorkflowStepError | Main exception class for workflow failures |
| cause | Original exception that triggered the failure |
| errors | List of multiple errors (for parallel failures) |
Configuration Options
| Attribute | Type | Default | Description |
|---|---|---|---|
cause | Exception | None | None | The underlying exception that triggered the failure (first error in fail_all mode) |
errors | List[dict] | [] | List of {"step": int, "error": Exception} for fail_all mode. Empty for fail_fast |
Common Patterns
Pattern 1: Single Step Recovery
Pattern 2: Parallel Error Analysis
Pattern 3: Graceful Degradation
Best Practices
Always Catch Specific Errors
Always Catch Specific Errors
Catch
WorkflowStepError specifically rather than generic Exception to handle workflow failures appropriately while allowing other errors to bubble up.Inspect Error Details
Inspect Error Details
Use the
cause and errors attributes to understand what specifically went wrong and implement targeted recovery strategies.Log Error Context
Log Error Context
Include workflow context in error logs to help with debugging and monitoring.
Design for Partial Success
Design for Partial Success
When using parallel execution, design your aggregation logic to handle partial results gracefully.
Related
Workflow Parallel
Parallel execution with failure strategies
Workflow Patterns
Common workflow implementation patterns

