David Martin Calalang
07/29/2025, 9:40 PMMarvin
07/29/2025, 9:40 PMMarvin
07/29/2025, 9:40 PMretries
is None
, which means no retries will occur unless explicitly specified
2. To enable retries, you need to explicitly set the retries
parameter in the task decorator
Here's how you can configure retries:
python
from prefect import task
# No retries (default behavior)
@task
def my_task():
pass
# With 3 retries
@task(retries=3)
def my_task_with_retries():
pass
# With 3 retries and specific delay between attempts
@task(retries=3, retry_delay_seconds=10)
def my_task_with_retries_and_delay():
pass
# With retries and increasing delay between attempts
@task(retries=3, retry_delay_seconds=[1, 5, 10])
def my_task_with_variable_delays():
pass
You can find more detailed information about configuring retries in the Prefect documentation.