Only When - workflow vs workflow step

Hi gang. Quick question… Is there a recommended best practice when it comes to having fewer total workflows vs. fewer steps within a single workflow?

For example, a Save/Update button in a popup. The popup features a button that’s labeled SAVE by default - for when you’re creating a new thing and the button’s parent group (popup) is empty. You then use a Conditional to change the button’s label to say Update if the popup’s thing is not empty, i.e. you’re looking to save changes to an existing thing.

When it comes to that button’s workflow, it seems you could do one of two things:
Option 1 - Create TWO workflows, each with ONE step each. One workflow for when the parent group is empty and one for when it’s not.
Option 2 - Create ONE workflow with TWO steps. One step that executes “Only when” the parent group is empty and the second step that executes “Only when” the parent group is not empty.

Is one approach recommended over the other for performance reasons or otherwise? Just curious, thanks!

1 Like

Hey @ThatFizzGuy

There could be performances benefits to using two separate workflows if there are many steps. Think about checking a condition one time instead of ten times.

Also, some require a separate workflow, for example, if you were checking a Boolean condition and then changing that Boolean in the same step it wouldn’t actually work properly.

For example, not one that I would do, just to make the point for simplicity.

Step 1 - When this is ‘yes’ change it to ‘no’.
Step 2 - When this is ‘no’ change it to ‘yes’

So this wouldn’t work in the same workflow. You would have to separate the workflow.

That’s the only thing at the moment I can think of.

It really just depends on what you are building. There is always more than one way to do something.

Hope that helps a bit. :blush:

4 Likes

thanks @J805 !

1 Like