← All notes

Pass small values between Airflow tasks with XComs

Answer: XComs, short for cross-communications, let one task push a value and another task pull it by key. Use the Task Context for those operations, not the database model.

Push and pull

XComs, short for cross-communications, are a mechanism that lets tasks exchange values. An XCom is identified by a key. Values are explicitly pushed and pulled to or from storage using xcom_push and xcom_pull. Perform XCom operations through the Task Context with get_current_context(). Updating the XCom database model directly is not possible.

Always specify task_ids explicitly when pulling from other tasks. You can also use XComs in templates. XComs can't be used to persist state across task retries or Sensors poke.

| xcom_push | xcom_pull | |---|---| | push a value | pull a value | | Task Context | get_current_context | | BaseXCom | backend subclass |

Keys and backends

A backend is a subclass of BaseXCom. Parameters include a key to store the XCom and a value to store. An optional serialize parameter specifies if the value should be serialized or not. If a key is provided to a query, only XComs with matching keys will be returned. Only XComs from a task with matching IDs will be pulled. A map_index, if given, clears XCom only from that particular mapped task. Passing None, the default, clears all XComs from the task.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Apache Airflow docs, XComs; Apache Airflow source, xcom.py. Apache-2.0. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Apache Airflow docs, XComs; Apache Airflow source, xcom.py. Apache-2.0.

Cite this

Permanent ID: iil:note:j365rtrd

iinventedlight. 2026. "Pass small values between Airflow tasks with XComs." iinventedlight Library, iil:note:j365rtrd, version of 2026-11-20. https://iinventedlight.com/library/notes/airflow-xcom/. License: CC-BY-4.0.

@misc{iil_note_j365rtrd,
  author = {{iinventedlight}},
  title = {{Pass small values between Airflow tasks with XComs}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-20},
  url = {https://iinventedlight.com/library/notes/airflow-xcom/},
  note = {Permanent ID iil:note:j365rtrd. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/airflow-xcom.md.