Phoebe Bright
11/11/2019, 1:58 PMJeremiah
ifelse()
or switch()
operators to create conditional branches. By combining these with a Parameter
to receive the input type
, you could have a single workflow that you’d call like flow.run(type=type)
.
The decision of whether to do this depends on how your flows are structured. For example, if your flows share some task logic but not the same dependencies (in your example, task “A” is in both flows but followed by different tasks), then it’s best to keep them as two separate flows because setting up the conditional dependencies could get messy. If, on the other hand, the branches following the condition are more distinct (a → b → c on one side on x → y → z on the other), then the full-Prefect approach is easier.
However as I said in the simple case you presented, nothing wrong with your approach and in fact it might be the simplest way to get going!Phoebe Bright
11/11/2019, 2:16 PMJeremiah
Phoebe Bright
11/11/2019, 2:43 PM