[New Feature] Action conditions

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.

41 Likes

This is absolutely great. Awesome! I’m going to make my workflows so much cleaner and easier to maintain and debug!

1 Like

Fantastic thanks guys!

Thank you! :smiley:

Ah yes! I was JUST thinking about wanting something like this.

This will reduce a lot of workflow and will help to debug without having to erase Actions. Thanks.

add: It will be great if you can deactivate “Do every five seconds” from the DEBUGGER view… when condition is not met @emmanuel .

Xmas gift!

2 Likes

I literally was just thinking about this earlier today. Great work!

Crazy, can’t wait to try it out! Thank you!

This is a very good news. It will let us reduce the number of workflows

:grinning: :joy:

This is a huge plus, allows me to drastically streamline some of my core workflows. Thank you @Bubble, this really is a great new feature.

Super cool!

13 Likes

Such a time saver, thanks!

Hi,

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.

Editor: https://bubble.io/page?type=page&name=only_when_test&id=forumapp3&tab=tabs-1
Preview: https://forumapp3.bubbleapps.io/version-test/only_when_test/sample:custom.only_when

  1. There is a Repeating Group with with two fields. User and Status Active (true/false - yes/no).
  2. 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?

Best,
Cem

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.

This is fantastic!

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?

It shouldn’t, but we need a simple test case to look into this (and a bug report).