Airflow Summit 2026 is coming August 31 - September 2 in Austin, TX. Register now to secure your spot!

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?