ExternalTaskSensor for cross-DAG dependencies
📖 Scenario: You are managing workflows in Apache Airflow. You have two DAGs: dag_a and dag_b. dag_b should wait for a specific task in dag_a to complete before starting its own tasks. This is a common real-world need when workflows depend on each other.
🎯 Goal: Build an Airflow DAG dag_b that uses ExternalTaskSensor to wait for the task task_in_dag_a in dag_a to finish before running its own task.
📋 What You'll Learn
Create a DAG called
dag_b with default argumentsUse
ExternalTaskSensor to wait for task_in_dag_a in dag_aAdd a simple
PythonOperator task called task_in_dag_b that runs after the sensorPrint a message in
task_in_dag_b to confirm it runs after the sensor💡 Why This Matters
🌍 Real World
In real projects, workflows often depend on other workflows. ExternalTaskSensor helps coordinate these dependencies safely.
💼 Career
Understanding cross-DAG dependencies is essential for Airflow users and DevOps engineers managing complex data pipelines.
Progress0 / 4 steps