@@ -226,3 +226,42 @@ Comparison
226226 - Airflow 2.2
227227 - Airflow 3.3
228228 - Airflow 3.2
229+
230+ .. _concepts-resumable-tasks-retry-policies :
231+
232+ Retry policies and durable execution
233+ ------------------------------------
234+
235+ Long-running tasks typically need two separate things together: a retry
236+ policy, and durable execution as defined above. Each is configurable per
237+ task, and together they let a workflow span days without losing progress.
238+
239+ A **retry policy ** decides whether a failed attempt gets another try, and
240+ how long to wait before it. This is :class: `~airflow.sdk.RetryPolicy ` and
241+ :class: `~airflow.sdk.RetryDecision ` (see :ref: `concepts:retry-policies `), or
242+ the LLM-driven
243+ :class: `~airflow.providers.common.ai.policies.retry.LLMRetryPolicy `, which
244+ uses a model to read the error and make that call. That policy adds its own
245+ ``fallback_rules ``, applied when the classification call itself fails, so
246+ the decision does not depend on the model being reachable (see
247+ :doc: `apache-airflow-providers-common-ai:retry_policies `).
248+
249+ **Durable execution ** is what that next attempt resumes from. Backed by the
250+ task state store described above, it is what lets a task recover a
251+ checkpoint written by the attempt before it, rather than starting over.
252+
253+ Long-running tasks, or LLM-driven tasks like agentic workflows, benefit
254+ most from both: the retry policy decides whether the error is worth
255+ retrying at all, and the task state store is what the retry resumes from.
256+
257+ Consider using both when a task:
258+
259+ * Runs long enough that a worker crash mid-run is a real risk, and
260+ * Needs a retry decision more nuanced than "always retry" or "never
261+ retry", for example retrying rate limits but failing outright on bad
262+ credentials.
263+
264+ The two operate independently. A task with ``retries=5 `` and a checkpoint
265+ still stops for good after six failed attempts (the initial attempt plus five
266+ retries), but each of those retries picks up from the last checkpoint instead of
267+ reprocessing files it already finished, or resubmitting a job that is still running.
0 commit comments