What if your workflows could talk to each other and wait perfectly without you lifting a finger?
Why ExternalTaskSensor for cross-DAG dependencies in Apache Airflow? - Purpose & Use Cases
Imagine you have two separate workflows (DAGs) in Airflow, and one needs to wait for a task in the other to finish before starting.
Without a proper tool, you might constantly check the status manually or run tasks out of order.
Manually tracking task completion across workflows is slow and error-prone.
You might miss updates, start tasks too early, or create complex scripts that are hard to maintain.
The ExternalTaskSensor automatically waits for a specific task in another DAG to complete before proceeding.
This makes cross-DAG coordination simple, reliable, and clean.
if check_task_done('other_dag', 'task_id'): run_my_task()
ExternalTaskSensor(
task_id='wait_for_task',
external_dag_id='other_dag',
external_task_id='task_id',
mode='reschedule'
)You can easily build workflows that depend on other workflows, ensuring tasks run in the right order without manual checks.
For example, a data processing DAG waits for a data extraction DAG to finish before starting its analysis tasks.
Manual cross-DAG coordination is complex and fragile.
ExternalTaskSensor waits automatically for tasks in other DAGs.
This leads to cleaner, more reliable workflow dependencies.