Skip to content

7. Pass the File Path Downstream

Difficulty: Medium · Topic: XCom

The DAG daily_load runs @daily from 2026-01-01 (no catchup). The file to load is only known at run time:

load and audit both run after find_file. If find_file fails, neither of them runs.

Your DAG file is run in a simulation of the Airflow 3 scheduler against 4 scenarios, including hidden ones.

Sample scenario: Friday to Sunday

Deployed 2026-01-02 12:00 UTC, read at 2026-01-04 01:00 UTC.

Expected runs

Hints

Hint 1A @task function's return value is stored as an XCom named return_value.
Hint 2In a templated field, read it with {{ ti.xcom_pull(task_ids="find_file") }}. This does not create a dependency, so you must set one yourself.
Hint 3Calling audit(find_file()) passes the value and sets the dependency at once.

Learn the concepts

More Airflow problems

All Airflow problems · Learn Airflow