Airflow & DAGs · Advanced Development

What is TaskFlow API?

Mediumtaskflowdecorators

Interview question

What is the TaskFlow API?

How to answer

The short answer

TaskFlow is a more Pythonic way to write with @task:

Python
@task
def extract():
    return "data.csv"

@task
def process(file):
    print(file)

process(extract())

Airflow wires dependencies and XCom for you. Cleaner, more readable, easier to maintain than always using classic operators + manual XCom.