We just pushed an exciting change to the workflow engine, which will be handy as soon as you have complex logic in your app. You can now define conditions at the action level. Very much like what you do for events, but for the action.
In run mode, when an action has a condition that is no, the action will be skipped entirely. Obviously, actions without a condition will run 100% of the times. Don’t forget to use the debugger to see if an action runs or not (and why).
This will help simplifying some workflows, while keeping the number of workflows hopefully lower. As usual, let us know via a bug report if you hit an issue with this new feature.
I think there is a possible bug with workflow count when “Only When” rule is applied for the action. I prepared a test page in the forum app. Please find it below.
There is a Repeating Group with with two fields. User and Status Active (true/false - yes/no).
There is a simple button workflow which sets the Cell’s “is_active” to “yes” only when the status is “no”
But even the status is “yes”, the workflow continues adding to workflow count. Please click the button and follow the workflow count. Can you people also test and confirm the issue?
I would imagine if the “event” registers as true, then the workflow is going to run and be counted. If you want to prevent the workflow from running at all, then shouldn’t the “only when” be put on the event instead of the action?
Thank you for the answer but, when this feature was launched it was said:
The workflow has only one action and it should be skipped. As a result of this no data should be written or modified. I don’t get it why this counts for a paid workflow.
Another example; a workflow which has 3 actions.
Show/hide → Navigate → Change Thing (Only when action)
If the last “only when action” returns false then there is no data written or modified again. Regarding the first announcement this should also not count for a paid workflow imho.
It seems like actions that trigger a custom event don’t evaluate the condition. It runs the custom event even if the condition is false. @emmanuel, is this by design or an oversigt?