airflow.example_dags.example_asset_state

Example Dag that demonstrates using AIP-103 asset state to track a watermark across DAG runs. The producer reads the last watermark, processes only new records, then advances the watermark. The consumer is triggered by the asset event and reads asset state to understand what the producer just loaded.

Asset state persists on the asset across runs — unlike task state which is scoped to a single task instance. This replaces the common pattern of storing watermarks in Airflow Variables, which have no asset-level scoping.

Attributes

ORDERS

Functions

load([asset_state])

consume([asset_state])

Module Contents

airflow.example_dags.example_asset_state.ORDERS[source]
airflow.example_dags.example_asset_state.load(asset_state=None)[source]
airflow.example_dags.example_asset_state.consume(asset_state=None)[source]

Was this entry helpful?