How to Prevent Retries for Specific Exceptions

Last updated: October 10, 2025

  • When using RetryPolicy in your assets, you can prevent retries for specific exceptions by using the allow_retries=False parameter in a Failure event

  • To implement this:

    • Import the Failure class from dagster

    • Raise a Failure with allow_retries=False in your exception handling

  • This is particularly useful when you have a RetryPolicy configured but need certain exceptions to bypass the retry mechanism, such as for validation errors or other scenarios where retrying would not resolve the issue

  • For more information about handling failures and op events, see the Dagster documentation on op events and failures