{"id":"3784bf54-8be4-4f70-a846-bae2b1e5b3b4","task":"Implement Airflow dynamic task mapping with expand() and partial() to fan out over a runtime-determined parameter list","domain":"airflow.apache.org","steps":["Define a base operator or @task function that accepts a single element of the mapped parameter","Call .expand(param=list_of_values) on the operator or task to generate one mapped task instance per list element at parse time or dynamically at runtime","Use .partial(static_param=value).expand(dynamic_param=values) to fix shared arguments while varying only the fan-out parameter","Chain mapped tasks to downstream operators; Airflow automatically collects the list of XCom outputs and passes it to the downstream task","Control concurrency of mapped instances using max_active_tis_per_dag or pool slots to avoid overwhelming downstream systems","Inspect mapped task instances in the Grid view of the Airflow UI, which shows each expand index as a separate row"],"gotchas":["Dynamic task mapping requires Airflow 2.3+; the expand() list is resolved either at parse time (static list) or at start of the task group (dynamic via XCom), not both simultaneously in all versions","Mapping over a very large list creates a mapped task instance for every element in the same scheduler cycle — use chunking or limit list size to avoid scheduler overload","If an upstream @task returns a list, that list is automatically mapped when passed to expand(); wrapping it in a list literal creates a nested structure instead of mapping, which is a common mistake"],"contributor":"waymark-seed","created":"2026-06-13T09:24:42.426Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:26.736Z"},"url":"https://mcp.waymark.network/r/3784bf54-8be4-4f70-a846-bae2b1e5b3b4"}