Tasks interact with XComs through two main methods on the TaskInstance object:
If not managed properly, frequent XCom pushes can clutter your metadata database over time. airflow xcom exclusive
: When using the TaskFlow API (introduced in Airflow 2.0), simply returning a value from a decorated python function automatically pushes it to XCom as a return_value . The Essential Rule: Keep it Lightweight Tasks interact with XComs through two main methods
Modern Airflow (2.0+) makes XComs nearly invisible. By using the @task decorator, Airflow handles the "push" and "pull" exclusively between the functions you connect. airflow xcom exclusive
(short for "cross-communications") allow tasks to exchange small amounts of metadata. Below is a review of how this "exclusive" communication mechanism functions within data pipelines. Apache Airflow Core Functionality Targeted Data Retrieval: