Does flow structure matter?

Post your questions and help other users.

Moderator: Martin

Econdoc
Posts: 153
Joined: 28 May 2016 20:06

Re: Does flow structure matter?

Post by Econdoc » 14 Jul 2016 21:40

Hmm. This is getting somewhat clearer, but not clear enough. Does Martin's reply mean the there is no difference between the two flow structures unless one of the actions in the horizontal flow is 'Execute Flow' ?
If that is the case, then my original question remains. Are the two flows equivalent?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Does flow structure matter?

Post by Martin » 15 Jul 2016 19:30

The parallel structure is not equivalent to the sequential one. The actions in the sequential version are executed one after the other. In the parallel structure, the three actions are executed more or less at the same time.
Assume that the actions in your example are of type Sleep: 10s. The sequential flow will take ~30s to execute, the parallel version takes ~10s to execute.

The other case explained to Wibbly is more interesting when the flow contains more actions, for example like this:

Code: Select all

     -----C-----
    |       |      |
   A1    A2    A3
    |       |      |
   A4    A5    A6
Actions A1, A2, A3 are execute in parallel. The flow waits until all three actions have been completed. It then starts to execute actions A4, A5 and A6 in parallel again. The flow is considered finished, when A4, A5 and A6 have finished executing.
When the actions are all executed relatively fast, you will probably not even notice this behavior. But when A1 is an action Sleep: 10s that takes a while to execute, you will notice that the flow waits until A1, A2 and A3 are all finished before it start to execute A4, A5 and A6, which might be surprising.

Wibbly
Posts: 418
Joined: 17 Mar 2014 09:02

Re: Does flow structure matter?

Post by Wibbly » 16 Jul 2016 06:53

The example above has 3 simple sequential arms. But when the arms are more complex, and perhaps have conditional loops, how does it work in effect? How does Automagic determine what 'layer' it's executing (layer A1/2/3 or layer A4/5/6 when the flows are complex) when it waits for one of the layers to complete before doing the next?

I'm just curious...

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Does flow structure matter?

Post by Martin » 16 Jul 2016 08:40

The next layer of actions are just the ones that follow the currently executing actions.

In the following diagram, assume B1->B2 loops four times:

Code: Select all

     --C--
    |      | 
   A1   B1<--|
    |      |      |
   A2   B2-----
    |
   A3
    |
   A4
    |
   A5
Automagic would execute it like this:
1. C
2. A1 + B1
3. A2 + B2
4. A3 + B1
5. A4 + B2
6. A5 + B1
7. B2
8. B1
9. B2

Post Reply