Skip to main content
Robust error handling is essential for production workflows. Fibonacci provides multiple mechanisms for handling failures gracefully, from automatic retries to custom error handlers.

Error Types

Fibonacci defines specific exception types for different error scenarios:

Basic Error Handling

Try-Catch Pattern

Accessing Error Context

Retry Configuration

Node-Level Retries

Configure retries for individual nodes:

YAML Retry Configuration

Workflow-Level Retry Defaults

Fallback Handlers

Node Fallbacks

Define fallback behavior when a node fails:

Fallback Chains

Conditional Fallbacks

Custom Error Handlers

Error Handler Functions

Async Error Handlers

Error Recovery Patterns

Graceful Degradation

Circuit Breaker

Partial Results

Timeout Handling

Node Timeouts

Workflow Timeout

Validation Errors

Input Validation

Output Validation

Logging and Monitoring

Structured Logging

Error Hooks

Metrics Export

Best Practices

Prevent runaway executions with appropriate timeouts:
For retries, exponential backoff prevents overwhelming failing services:
Include relevant context when logging errors:
Design workflows to handle partial results when appropriate:

Next Steps

Best Practices

Production workflow patterns

Security

Secure your workflows