When external data arrives unpredictably, a FileSensor lets an Airflow DAG start checking immediately instead of waiting for a fixed delivery time. It repeatedly tests whether a specified path exists, succeeding when the file appears and continuing to wait while it is absent. section 7.1
Wait for a supermarket file
from airflow.providers.standard.sensors.filesystem import FileSensor wait_for_supermarket_1 = FileSensor( task_id="wait_for_supermarket_1", filepath="/data/supermarket1/data.csv", ) The sensor pokes by default every 60 seconds. Set poke_interval to change that cadence, and configure a timeout to stop waiting after a limit. Avoid intervals so short that repeated checks overload the target system. section 7.1
A matching filename does not always mean that an upload is complete. FileSensor supports glob patterns such as data-*.csv, but it may succeed after only the first file arrives. Use a final _SUCCESS marker to signal completeness, or use PythonSensor when the condition must verify both data files and the marker. section 7.1.1
