Airflow Xcom Example -

# Push context['ti'].xcom_push(key='user_id', value=123) user = context['ti'].xcom_pull(task_ids='task_a', key='user_id')

process = PythonOperator( task_id='process_order_task', python_callable=process_order )

extract >> process

from airflow.operators.python import PythonOperator def push_func(ti): ti.xcom_push(key='result', value='hello_xcom')

Title: Mastering Data Sharing in Airflow: XComs Explained with a Real Example airflow xcom example

One of the most common questions when building DAGs is: 👉 "How do I pass data from one task to another?"

Use return as a shortcut – return value auto-pushes to return_value key. # Push context['ti']

1/4 Ever needed to pass a value from one Airflow task to another? → Use (Cross-Communication). Think of it as a mini shared dictionary for your DAG run. 🧠

Meyaoi