Airflow Summit 2025 is coming October 07-09. Register now for early bird ticket!

FileSensor

Use the FileSensor to detect files appearing in your local filesystem. You need to have connection defined to use it (pass connection id via fs_conn_id). Default connection is fs_default.

airflow/providers/standard/example_dags/example_sensors.py[source]

t6 = FileSensor(task_id="wait_for_file", filepath="/tmp/temporary_file_for_testing")

Also for this job you can use sensor in the deferrable mode:

airflow/providers/standard/example_dags/example_sensors.py[source]

t7 = FileSensor(
    task_id="wait_for_file_async", filepath="/tmp/temporary_file_for_testing", deferrable=True
)

Was this entry helpful?