Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. What is TaskFlow API?

Airflow & DAGs · Advanced Development

What is TaskFlow API?

Mediumairflow-22
taskflowdecorators

Question

What is the TaskFlow API?

Solution

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

@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.

PreviousNext