If a task returns a value, Airflow automatically pushes it to XCom with the key return_value . This is the cleanest way to write your code.
XComs are the "glue" that allows Airflow tasks to talk to each other. By understanding how to Push, Pull, and leverage Automatic XComs, you can create dynamic workflows where the output of one task determines the behavior of the next. airflow xcom example
While XComs are powerful, they are often misused. Here are the golden rules: If a task returns a value, Airflow automatically