XComs allow tasks to "push" and "pull" metadata or small results. They are stored in the Airflow metadata database and are keyed by: dag_id : The specific workflow. task_id : The originating task. run_id : The specific execution instance. key : A custom identifier (defaults to return_value ). 🔒 Implementing "Exclusive" Scoping
Here's a simple example of how XCom works: airflow xcom exclusive
def push_metadata(**kwargs): ti = kwargs['ti'] ti.xcom_push(key="source_file_path", value="/data/raw/2025-01-01.csv") ti.xcom_push(key="record_count", value=15234) ti.xcom_push(key="processing_status", value="SUCCESS") return "push_complete" # Also auto-pushed with key "return_value" XComs allow tasks to "push" and "pull" metadata
Print this page.
The PDF will include all information unique to this page.
Download PDF of the entire 2025-2026 Undergraduate catalog.
Download a PDF of the entire 2025-2026 Graduate catalog.