'Create Multiple Subdags in One DAG

I have in main_DAG, multiple tasks (which are subdags): subdag1, subdag2, subdag3. Whenever I try to create a flow like this:

main_DAG>>subdag1>>subdag2>>subdag3

I get this error:

Tried to set relationships between tasks in more than one DAG: dict_values([<DAG: main_DAG, <DAG: main_DAG.subdag2>])

But when I write this:

main_DAG>>subdag1>>subdag1>>subdag1

I don't get any error. SO, is there any way I can use diferent subdag tasks in the same DAG?



Solution 1:[1]

You can write it this way

main_dag >> [subdag1, subdag2 , subdag3]

In this way once main_dag completed it will trigger subdag1,subdag2 & subdag3 at once in parellel.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Vishal Bulbule