The way Workflows work today has been causing me some serious problems. In particular, I wish to return execution from a workflow at any given time, using a “Return” statement, like if it was a real function.
They are very much like functions already, they take in and return parameters, but we’re hamstrung when it comes to flow control.
We’ve been earning more and more trust from our colleagues, which is awesome, but it also means we’re dealing with ever more complex business logic. We need tools to cope with that.
I will leave it up to @alexandru to comment on it further, but I will share some thoughts first.
The way to achieve it now is to either use a flowchart that will end the currently invoked workflow based on specific conditions or to base your process on state machines.
Not allowing for an abrupt exit out of a workflow might be related to the way the processes currently work, which is pretty much based on a sequential execution of each action. One could use an argument that adding such functionality would actually reduce the “readability” of the processes (kind of a
goto type of discussion).
Either way, I’ll add it to our internal tracker for future consideration
We have plans to create a Return activity that will end execution for the current workflow and return to where it was invoked. Most likely it will be available later this year.
Follow up from 2022 :). Is it available?