Airflow Xcoms Official

– Possible but painful. You need to specify dag_id and run_id , and the DB overhead grows quickly.

def push_multiple_values(**kwargs): ti = kwargs['ti'] ti.xcom_push(key='file_name', value='data.csv') ti.xcom_push(key='row_count', value=500) airflow xcoms

| Aspect | Rating | Notes | |--------|--------|-------| | | ⭐⭐⭐⭐ | Zero extra setup – return values are automatically stored. | | DAG readability | ⭐⭐⭐⭐ | Data flow is explicit when using .xcom_pull() . | | Lightweight coordination | ⭐⭐⭐⭐⭐ | Perfect for passing IDs, flags, dates, small configs. | | Backend support | ⭐⭐⭐ | Works with any Airflow DB backend (Postgres, MySQL, SQLite, etc.). | – Possible but painful

XComs are short for "cross-communications." They allow a task instance to "push" a value to the Airflow metadata database, which another task can subsequently "pull." They are defined by a key, value, and timestamp. An XCom is uniquely identified by: : The ID of the DAG. task_id : The ID of the task that pushed the data. key : The specific identifier for the message. | | DAG readability | ⭐⭐⭐⭐ | Data

– e.g., returning a whole CSV from a task. This bloats the DB, slows down the scheduler, and can cause deadlocks.

If your tasks are failing or the wrong data is being pulled, you can inspect XComs in the Airflow UI: Go to the tab. Click on XComs .