Dynamic task mapping lets an Apache Airflow DAG create task instances at runtime from iterable values produced during a DAG run. It suits pipelines whose workload changes, such as fetching a variable number of daily movie reviews. Instead of processing every review in one task, Airflow can create one mapped instance per review, improving atomicity and enabling independent retries and parallel processing. section 12.1.8 section 12.5
Movie-review processing
A fetch_ratings task requests /reviews/latest and returns the reviews. A mapped print_rating task expands over that output, printing each movie and rating separately. The same pattern can be written with the Taskflow API as print_rating.expand(rating=fetch_ratings()), or wrapped in a mapped TaskGroup when each review needs a small workflow.
