Using flows as subflow

I know it is possible to execute a flow from a flow, but is it possible to call a subflow from a mainflow and that after the subflow has been executed the mainflow will continue? As is the case when calling a subroutine in a program?

No. Unless you built a mechanism yourself. For example: Start sub flow from main flow. Wait for sub flow to set a logic variable to indicate it has run. Then continue main flow.

You can use the ‘flow is started with texttag’ and use it kindof like a label.

Mainflow

[do mainflowthings] - Start mainflow with texttag ‘subflow’

If flows is started with texttag and textag is ‘subflow’
[do subflow things] - Start mainflow with texttag ‘mainflow2’

If flows is started with texttag and textag i ‘mainflow2’
[do rest of mainflowtings]

1 Like

Are you sure?

Because if you put the flow cards in series, then the card that follows the flowcard that runs the sub flow, is not executed before the sub flow completes:

Main flow

Sub flow

Timeline

As you can see, the time line message of the main flow is only posted after the sub flow (that includes a 5 sec delay) completes.

1 Like

But that is just like subroutines in program code work, the code is executed sequentially, and after the subroutine is executed the program continues with the next statement of the main program.

The idea is to put the subflow on a different canvas, to keep the main flow clear.

That is precisely my example: the first (main) and second (sub) flow are on two separate canvases.

Maybe I am misunderstanding you :thinking:?

You understand me very well, and I will try your example.

1 Like

You may also do this with Advanced Trigger app.