def pull_func(ti): value = ti.xcom_pull(task_ids='push_task', key='result') print(value)
Go to Task Instance → XCom tab → See key-value pairs.
3/4 ⚠️ Warning: XCom is NOT for large data (no CSVs, no models). Keep it under 48KB. Use S3/GCS for big files.
process = PythonOperator( task_id='process_order_task', python_callable=process_order )
def process_order(**context): # Pull from XCom order_id = context['task_instance'].xcom_pull( task_ids='extract_order_task', key='order_id' ) print(f"Processing order: {order_id}")
XComs allow tasks to exchange small pieces of data (e.g., IDs, filenames, metadata). Think of them as a shared key-value store across your DAG run.
extract = PythonOperator( task_id='extract_order_task', python_callable=extract_order )
extract >> process