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 |
Failed Task Propagation
When tasks fail after exhausting retries, dependent tasks are automatically skipped instead of running withNone context:
How It Works
Example
Failure Propagation Rules
- Failed Task: When a task fails after
max_retries, itsstatusis set to"failed" - Dependent Detection: Tasks with
context=[failed_task]are identified as dependents - Skip Execution: Dependent tasks are marked as
"failed"without execution - No None Propagation: Dependent tasks don’t receive
Nonevalues from failed dependencies
Process Integration
This behavior works consistently across all process types: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

