How can I specify the retry behavior for a specific task?

Prefect 2.0

You can set the maximum number of retries as an integer value on the @task decorator. The same applies to the retry delay:

@task(retries=2, retry_delay_seconds=60)

Prefect 1.0

Prefect 1.0 uses a slightly different syntax. The retry_delay expects a datetime.timedelta() object.

@task(max_retries=2, retry_delay=datetime.timedelta(minutes=1))