Flow - Run vs Run Flow, bootbox dialogs

What is the difference between the Run & Run Flow? I can’t see any difference expect for the icons used. Thanks.

Also, are the bootbox dialogs under the “Control Flow” category duplicated accidentally (in the above screenshot)? Or are these different in any way?

Run is used to run different App Connect components already placed on the page.
Run Flow is pretty much self explanatory. It allows you to run other Flows already placed on the page.

The components in the Bootbox category are different than the ones you see on your screenshot. Bootbox dialogs are nicely styled in Bootstrap 4 style, while the regular prompt/alert/confirm are just standard/native browser dialogs.

3 Likes

Thanks @Teodor for clarification on the diff between bootbox and standard dialogs.

Reg the other one, both Run & Run-Flow lets you pick any component without any difference. I just asked to make sure I don’t use them incorrectly.

image

I thought clicking on Run-flow would display only the list of flows on the page to pick from.

@teodor

Some questions on this…

  1. Am I right in saying that if I execute a Run command in a flow it will execute asynchronously, e.g. the next item in the flow will execute before the Run command has finished?

  2. If I do this following

Flow A
- Statement 1
- Run (Flow B)
- Statement 2

Then will Statement 2 potentially execute while Flow B is running?

  1. If I do this:
Flow A
- Statement 1
- Run Flow (Flow B)
- Statement 2

Will statement 2 wait for Flow B to finish?

If not, is there any way for me to execute Flow B and have Flow A wait until Flow B has finished before executing Statement 2?

Thanks!
Antony.

Never tried but perhaps look at using Wait with parameter Flow B.running

Thanks Brian… Wait seems to be wanting a delay parameter which imples a number, so I’m not clear that this is the solution.

All actions in a flow are called async. When the function called with Run returns a promise it will wait until it is finished otherwise it will directly continue with the next action.

The flow run method returns a promise, so Statement 2 will wait until Flow B is finished. A serverconnect load method does not return a promise, so Statement 2 will execute before the serverconnect is loaded.

Yes, it will wait for Flow B to finish.

Thank you @patrick!

So just to be clear, are you saying I HAVE to use a Run Flow action rather than just a Run action to make Flow A wait for Flow B to execute?

Just Run will also work since the run method on the Flow component returns a promise, as long the method called returns a promise it will wait for it.

This does not work so for API and Server Connect components who do not return promises in their load method but using the special serverconnect and api flow action do wait for them to finish.

Thanks @patrick!

So is there actually any situation where I would want to use Run Flow rather than just Run? :thinking:

And…

Does a Run action which does a SetValue perform a promise?

The Run action updates the data of the Flow component on the page where you call the method from. When using Run Flow it will be run as a subflow and the data of the component is not updated but the data is accessible as output from the step.