Xcom Airflow «Certified - 2027»

def pull_function(**context): value = context['ti'].xcom_pull(key='message', task_ids='push_task') print(f"Received: value")

with DAG(dag_id='xcom_demo', start_date=datetime(2024,1,1), schedule_interval=None) as dag: xcom airflow

Received: Hello from Task 1 3. Return Values as Implicit XComs If a Python callable returns a value, Airflow automatically pushes it under the key return_value . def pull_function(**context): value = context['ti']

push >> pull