What is the difference between airflow trigger rule “all_done” and “none_failed”?

Viewed 1912

I made dag with branchpythonperator task, and it calls two task. One task will be skipped, one will be executed. After executing this task, dag must execute another task. For this task I used trigger rule all_done, and try none_failed. Both this rule behave pretty similar. What is the difference?

1 Answers

ALL_DONE : All the tasks are done i.e. in one of the following state : succeeded, failed, skipped or upstream_failed NONE_FAILED : None of the tasks have failed i.e would be in one of the following state : succeeded, skipped

For your scenario, try failing one of the tasks in-between and see the difference in behavior. The task with trigger rule all_done will be kicked off while the task with trigger rule 'none_failed' will not.

For further reference, take a look at the source code for Trigger_Rule (line 187 to line 198 would answer your question) : https://github.com/apache/airflow/blob/master/airflow/ti_deps/deps/trigger_rule_dep.py#L187

Related