Airflow & DAGs · Core Concepts & DAGs

How do you define task dependencies?

Easydependenciesbitshift

Interview question

How do you define task dependencies in Airflow?

How to answer

Python
task_a >> task_b   # A must finish before B starts
task_a << task_b   # B must finish before A

Example:

Python
extract >> transform >> load

You can also write:

Python
extract.set_downstream(transform)

Fan-out / fan-in:

Python
extract >> [validate, enrich] >> load