In short.
This guide explains recovery for developers running Pydantic AI agents in Apache Airflow, but durable tasks cannot stream responses or pause for human approval. It covers AgentOperator and @task.agent with durable=True, using task retries to reuse completed model requests and tool calls. Airflow 3.3 or newer together with provider 0.7.0 or newer uses the task state store; other combinations require configured object storage. Recovery stays within one task instance. Changed request fingerprints cause live execution, requests that cannot be fingerprinted use unverified positional replay, and batch requests are not cached. The examples are untested here, and measured reliability, performance and savings are unknown.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage includes the complete supplied page at [https://pydantic.dev/docs/ai/capabilities/durable_execution/airflow/index.md], including both examples and its caveats about retries, version-dependent storage, fingerprint and positional replay, tool effects, human review, streaming, batching and cache lifetime. Linked documentation, package code and external pages are excluded. No commands or examples were executed. Runtime behavior, deployment compatibility, performance, prices and licensing remain unverified or unknown where the page supplies no evidence.
The overview
Resource and scope
The resource is a Pydantic AI documentation guide to durable execution through Apache Airflow, a system for scheduling and coordinating workflows. The integration comes from apache-airflow-providers-common-ai through airflow.providers.common.ai, rather than pydantic_ai.durable_exec.
The recoverable unit is an Airflow task. The guide explains how an agent can reuse completed operations when that task retries. The source is [https://pydantic.dev/docs/ai/capabilities/durable_execution/airflow/index.md].
Practical value
The guide is most useful when an Airflow agent makes several slow or paid calls and a worker failure would otherwise repeat successful work. It provides enough configuration detail to understand the recovery model and prepare a small evaluation.
Its operational boundaries matter: cached work belongs to one task instance, successful completion clears the cache, and some requests receive weaker replay checks. The page provides no recovery benchmarks or demonstrated production outcomes, so suitability for a particular deployment remains unassessed.
Who it is for
The primary audience is developers and workflow engineers already using, or preparing to use, Pydantic AI agents inside Airflow. Long-running research agents and agents that call database or external-system tools are relevant examples.
Beginners get a concrete explanation of replay and two compact Python examples. Applying them still requires familiarity with Airflow workflow definitions, connections and retries. The guide does not provide a complete introduction to deploying Airflow or managing model credentials.
What it supports
AgentOperator and the @task.agent decorator support durable=True. During a task run, wrappers record completed model requests and Pydantic AI tool calls so matching steps can return their saved results on retry.
Tool-call caching includes calls through Airflow toolsets such as SQLToolset, HookToolset and MCPToolset. Returning a completed tool call's cached result avoids invoking that tool again during replay. Airflow task settings control retry count and delay.
Using it
Required components
The setup requires Airflow, apache-airflow-providers-common-ai and a concrete model configured for the agent. The examples obtain the model and credentials from an Airflow connection named pydanticai_default. Recovery requires task retries, configured through retries and retry_delay.
Automatic cache storage requires both Airflow 3.3 or newer and apache-airflow-providers-common-ai 0.7.0 or newer. If either component is older, set [common.ai] durable_cache_path to a local or object-storage location that workers can read and write. The page lists local storage, S3, GCS and Azure as options.
The page does not establish minimum Python requirements, the oldest supported Airflow/provider combination, or the complete connection and storage-access configuration.
How recovery works
On retry, execution replays the agent's steps. Each cached entry normally includes a fingerprint representing the request that produced it. A matching fingerprint returns the saved result; a mismatch executes the step live, avoiding reuse of a result from a diverged conversation.
When a request cannot be serialized into a fingerprint, the system falls back to unverified positional replay: it uses the step's position without verifying request equivalence. The guide therefore calls for deterministic runs across retries.
The cache belongs to one task instance and is deleted after success. With the newer task state store, entries remaining after an ultimately failed run are removed when its DAG run is deleted. Equivalent failed-run cleanup for legacy object storage is not described.
Configuration path
The documented installation command is uv add "apache-airflow-providers-common-ai", alongside Airflow. Configure an Airflow connection that supplies a concrete model and its credentials, reference it with llm_conn_id, enable durable=True, and configure task retries.
For the newer version combination, the cache uses the task state store without separate cache-storage configuration. Its default location is the Airflow metadata database. The page warns that worker writes exceeding [state_store] max_value_storage_bytes, whose default is 64 KB, are logged and stored anyway. Configure [workers] state_store_backend to offload large payloads.
For an older Airflow or provider version, configure [common.ai] durable_cache_path; the example value is s3://my-bucket/airflow-agent-cache. Full connection and backend setup details are outside this page.
Examples in the guide
The first example defines an Airflow DAG with three retries and a 30-second retry delay. Its AgentOperator task is named researcher, uses pydanticai_default, enables durable=True and asks for a summary of quantum error correction.
The second example uses @task.agent for an orders-data analyst. The decorated function returns the prompt, while SQLToolset connects through postgres_default with allowed_tables set to orders. The question asks for last month's total revenue.
The recovery illustration describes a worker failing after a model response completes. On retry, that response is reused and execution continues with unfinished work. These are documentation examples; no execution results establish that either example works in a particular environment.
Assessment & evidence
Recovery boundaries
durable=True cannot be combined with enable_hitl_review=True. Streaming is also unsupported because the durable wrapper records complete model requests rather than streamed events. Batched model requests fall outside the cache.
The documented protection against repeating tool effects applies to completed, cached calls. Protection against a worker failing after an external write but before its result is saved is not established. A practical implication is to design external writes to tolerate retries; end-to-end exactly-once execution is not demonstrated.
Positional replay cannot verify request equivalence when fingerprinting fails. Large tool results can enter the metadata database despite the configured size-warning threshold. The page does not quantify cache capacity, recovery latency or behavior under storage failures.
How to judge fit
The strongest fit is an Airflow task whose expensive model requests and tools follow a stable execution path across retries. Preserving completed results addresses a specific failure cost: repeating successful work after an interruption.
The decision depends on which features the agent needs. Interactive approval and streaming require a different task configuration, while un-fingerprintable requests weaken replay validation. The expected benefit follows from the documented mechanism; its magnitude and reliability in a particular workload remain unknown.
Other configurations described
Ordinary Airflow task retries restart execution without this step cache, which can repeat earlier model requests and tool effects. They provide a simpler option when preserving completed agent operations is unnecessary.
The page directs streaming agents to non-durable tasks. For human approval, rejection or change requests, AgentOperator offers enable_hitl_review=True through Airflow's HITL interface, separately from durable execution. The page does not provide enough information to compare other durable-execution frameworks.
Source and evidence limits
The evidence is the complete supplied documentation page at [https://pydantic.dev/docs/ai/capabilities/durable_execution/airflow/index.md], retained as selected-page.txt. Its source revision is sha256:8161788262cb1469af5943a9e3708015f6b29d876a17a3bd80dd581c6e63cf26.
The page supports the configuration examples and stated recovery behavior. Linked connection guides, API references, batch documentation and implementation code are outside the supplied scope. No code was executed; recovery behavior, compatibility and performance have not been independently verified.
Access & freshness
Costs and repeated work
The page gives no prices for model usage, Airflow hosting, database capacity or external storage. Total setup and operating costs are unknown. Reusing completed requests can avoid paying for those same operations again, but the guide provides no measured savings.
Batched model requests are not cached. A retry resubmits a request that was waiting on its batch into a new batch, which is billed again. Fingerprint mismatches also trigger live execution and may repeat billable work.
Licensing and reuse
The supplied page does not state licensing or redistribution terms for its prose, embedded examples or the provider package. Those permissions are unknown from this evidence; the presence of installation commands and examples does not establish redistribution rights.
Date and version context
The supplied page was captured at 2026-11-15T14:29:20.550Z. It identifies Airflow 3.3 and provider 0.7.0 as the thresholds for using the task state store without separate cache-storage configuration.
The page gives no publication or last-update date. Its statements that streaming and combined human review are unsupported describe this captured documentation; later changes are unknown. The cited version thresholds do not establish which releases are currently newest.
Suggested next steps
Check both Airflow and provider versions, then choose the documented storage configuration. Configure a connection with a concrete model, enable durable=True and set task retries. Decide whether streaming or human review is required before choosing durable mode.
For an evaluation, use a development task that completes a model request and a tool call before a controlled failure. Check whether a retry reuses those results, whether changed requests run live and whether large results use the intended storage backend. These are proposed checks, not completed tests.
Review external writes for retry tolerance and account for uncached batch requests. Use the linked connection and operator references to resolve details that this page leaves unspecified.
