Skip to main content
Workflow error handling provides structured exception handling for step failures, enabling robust parallel execution and graceful error recovery.
The user runs a workflow; WorkflowStepError surfaces the failing step and root cause for recovery.

Quick Start

1

Basic Error Handling

2

Handling Multiple Errors


How It Works


Configuration Options


Failed Task Propagation

When tasks fail after exhausting retries, dependent tasks are automatically skipped instead of running with None context:

How It Works

Example

Failure Propagation Rules

  1. Failed Task: When a task fails after max_retries, its status is set to "failed"
  2. Dependent Detection: Tasks with context=[failed_task] are identified as dependents
  3. Skip Execution: Dependent tasks are marked as "failed" without execution
  4. No None Propagation: Dependent tasks don’t receive None values 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

Catch WorkflowStepError specifically rather than generic Exception to handle workflow failures appropriately while allowing other errors to bubble up.
Use the cause and errors attributes to understand what specifically went wrong and implement targeted recovery strategies.
Include workflow context in error logs to help with debugging and monitoring.
When using parallel execution, design your aggregation logic to handle partial results gracefully.

Workflow Parallel

Parallel execution with failure strategies

Workflow Patterns

Common workflow implementation patterns