Repository navigation
Replies: 1 comment
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
I would like to propose a feature for the Airflow 3.x roadmap to natively support Sequential and Fail-Fast execution within the Dynamic Task Mapping framework (
.expand()).As Airflow 2.x moves past its April 2026 EOL, defining core task orchestration boundaries for Airflow 3.x is highly relevant. Currently, Dynamic Task Mapping operates on a strict parallel MapReduce assumption where all mapped indices (
map_index=0, 1, 2...) are independent. However, production workflows frequently require runtime-generated data chunks to execute chronologically, where an early failure must immediately halt the remaining sequence.The Architectural Problem
While concurrency controls like
max_active_tis_per_dag=1can force serialized execution, they fail to create state-based dependencies between individual sibling indices:map_index=0fails, Airflow still triggersmap_index=1andmap_index=2. In data loops where downstream steps assume the integrity of upstream modifications, this causes resource waste and data corruption.fail_stop=Trueflag stops the entire DAG. This is too destructive when you only want to break execution for a specific mapped task array while letting independent branches finish normally.Proposed Airflow 3.x API Design
I propose introducing two parameters to the execution mapper:
sequential: bool = Falseandfail_fast: bool = False.Strategic Technical Implementation
Because this modifies core scheduling assumptions, I want to ensure it integrates seamlessly with Airflow 3.x's scheduler architecture:
Gated Execution (
airflow/models/dagrun.py):Inside
_get_ready_tis(), ifsequential=Trueis enabled, the scheduler gates the readiness ofmap_index = Nuntilmap_index = N-1reaches a terminalSUCCESSstate.State Cascading (
airflow/ti_deps/deps/trigger_rule_dep.py):If
fail_fast=Trueis active andmap_index = Nswitches toFAILED, the scheduling loop automatically cascades all subsequent un-run sibling indices (N+1to max index) directly toUPSTREAM_FAILED.Seeking Community Feedback
I am prepared to lead this implementation and draft an Airflow Improvement Proposal (AIP) if required. Before taking this to the devlist, I would love initial feedback:
All reactions