Home > Basic > xcom airflow > xcom airflow

Xcom Airflow Fix -

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 .

Here’s a technical write-up on — covering what it is, how it works, use cases, limitations, and best practices. XCom in Apache Airflow: Cross-Communication Between Tasks 1. Overview In Apache Airflow, each task instance is typically isolated. Tasks cannot share variables or data directly. XCom (short for cross-communication ) is the mechanism that allows tasks to exchange small pieces of data. xcom airflow

push >> pull

with DAG(dag_id='xcom_demo', start_date=datetime(2024,1,1), schedule_interval=None) as dag: Received: Hello from Task 1 3

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