Xcom In Airflow ◆ 〈BEST〉

If Task A processes a file and generates a unique ID, and Task B needs that ID to perform a database lookup, they cannot simply share a variable in memory. This is the specific problem that XCom, short for cross-communication, was designed to solve. How XCom Works Under the Hood

XComs are Airflow’s glue. They turn a set of isolated tasks into a coherent pipeline. Use them for small control signals, IDs, and results. Keep them light. And when you’re tempted to pass a big blob of data – stop, and ask yourself: should this be in object storage instead? xcom in airflow

@task def consume_two(data): return f"Got data['source']" If Task A processes a file and generates

@task def consume_one(data): return f"Got data['ids'][0]" short for cross-communication