Configure workflow error handlers
Handle workflow errors at the block level or globally.
As you build workflows of increasing complexity that interact with more data sources, it's important to handle errors and debug unexpected behavior effectively. You can configure blocks to function as error handlers and perform actions should any errors occur during the run.
Block-level vs. global error handling
Workflows support two types of error handling that work together to give you fine-grained control over error behavior.
Use block-level error handling when:
- You need different error handling logic for specific blocks.
- You want to retry or provide fallback values for particular operations.
- Errors should be handled without terminating the workflow.
Use global error handlers when:
- You want to catch all unhandled errors in one place.
- You need consistent error logging or notifications for unexpected failures.
- You want a safety net for errors you didn't explicitly handle.
You can use both approaches together. Handle expected errors at the block level, and use a global error handler as a catch-all for unexpected failures.
Block-level error handling
Individual blocks can handle their own errors using On Error connectors. When a block fails, you can connect it to a downstream block that handles the failure. This is useful when you want to:
- Handle specific errors differently for different blocks.
- Perform custom recovery actions for a particular operation.
- Continue workflow execution with alternative logic after a failure.
To use block-level error handling:
- Select the block Settings.
- Change Finally to Continue.
- Drag the red On Error connector that appears to connect it to another block that will handle the error.
Retry failures automatically
For more granular error handling, you can configure error handlers to automatically execute again. This allows your workflow to automatically retry failed blocks with a specified schedule. Setting an exponential backoff can be especially useful for retrying blocks that query rate-limited APIs or data sources.
To configure retry settings, select Settings on the block. Refer to Resource query block settings to learn more.
