when you add the decision in a submicroflow and then return either variable2 or 3 depending on the outcome, then call the microfo from the depicted microflow you will get 1 variable with the value of variable2 or 3 and then there is no need to duplicate the functionality.
You just make sure you return the result from the microflow.
Hi Hartley Robinson,
what you have done is right.
As a part of optimization of microflow or to reduce the steps of microflow, you can do something like below.
Create a String variable in main microflow and change it in sub-microflows(as it will be available in sub-microflows too), then there is no need of returning the variable as output.
And as it is in the memory, the variable is automatically available and updated in main microflow