bullmq
bullmq copied to clipboard
Branching during Flow execution
I am interested in knowing if this type of flow execution is possible. This is not necessarily a feature request. I'm using BullMQ with NodeJS.
In a given flow, the parent-children dependency tree is given at flow creation time.
Let's say that during the execution of a child task there is a boolean result 'answer'. There are two chained strands of tasks that depend on this child task result 'answer'. Is it possible to run one branch and ignore the other depending on 'answer' value? Say for 'true' run one branch and for 'false' run the other?
Currently I'm designing a mechanism that relies on failing the first child of the non-executable branch and using 'ignoreDependencyOnFailure' when the branch results merge back together. I was wondering if there are other primitives or if there's a more idiomatic way of achieving this.