Question about Looping and Routing Setup

What are you trying to achieve?

How do I correctly set up the filters and variable management so that the data passes through the first flow three times before moving to the second flow? What modules or settings should I use to achieve this behavior?

Steps taken so far

Hello, Make.com community!

I have a task where the first stream needs to run several times (e.g., three times), and after each iteration, the data should be sent to a webhook. When the data returns from the webhook, it should trigger the first stream again. This process should repeat until the specified number of iterations (e.g., three) is reached.

After the third set of data completes the first iteration, it should move to the second (final) stream and complete the scenario.

Problem:
Currently, the first stream runs, sends data to the webhook, and as soon as the data returns, it immediately goes to the second stream, bypassing the required number of iterations. I need the data to go to the second stream only after passing through the first stream three times.

My setup:

I use a Router to split the streams.
I use filters to manage the counter variable.
I have set up the counter increment after each execution of the first stream.
Question:
How do I properly set up the filters and manage the variables so that the data goes through the first stream three times before moving to the second stream? What modules or settings do I need to achieve this behavior?

Thank you in advance for your help!

Screenshots: scenario setup, module configuration, errors

Hi @Zmicer,

Without clearly understanding your flow, let me ask you a question: is your scenario calling itself? If so, can you add the run in the parameters? Something like “…?iteration=1”. Then you can check which iteration is being executed and make the right decision.

L

Not exactly, the scenario triggers another scenario, which in turn triggers yet another scenario, and only then is this scenario called…

So, let’s say you have three scenarios and the one above is S1.

Are you saying that the flow is:

S1 (partial) → S2 → S3 → S1 (full)

I see that the HTTP module is the first call so I think the approach I outlined could work. S3 would need to provide the parameter that makes S1 understand that it has to do the full run.

If my understanding is incorrect, let me know.

L

iteration=1 - Where exactly should this be added?

No, I need the last scenario to count the passes. For example, after two passes, it should stop sending to any webhooks and just go directly to the finish.

It would be:

https://make.com/you-scenario-link/?iteration=1

https://make.com/you-scenario-link/?iteration=2

L

I’m still not getting it. I may be very tired, too…

Can you illustrate the sequence?

Is it:

S1 (partial) → S2 → S1 (partial) → S3 → S1 (full)

If so, and if the HTTP module is the one calling S2 or S3, then you can still use the approach I mention.

so S2 could do:

https://make.com/scenario-1-link/?iteration=2

And S3 could do

https://make.com/scenario-1-link/?iteration=3

You would need to check the value of the iteration parameter of the webhook to see if it has the value you need.

There is a course in the Make Academy that covers this, here:

https://academy.make.com/courses/IntermediateC04

L

Oh, and instead of having a single route, you would have two or three routes, with a filter on the value of “iteration”. So on the first pass it would call S2. SOn the second S3 and on the third, the full process.

L

S1 (full) → S2 (full) → S3 (full) → S1 (full) → S2 (full) → S3 (full) → S1 (Finish branch)

Hmm… OK. So it could look something like this:

  1. Trigger S1 with : https://make.com/scenario-1-link/?iteration=1
  2. S1 calls S2 with: https://make.com/scenario-2-link/?iteration=1
  3. S2 calls S3 with: https://make.com/scenario-3-link/?iteration=1
  4. S3 calls S1 with: https://make.com/scenario-1-link/?iteration=2
  5. S1 calls S2 with: https://make.com/scenario-2-link/?iteration=2
  6. S2 calls S3 with: https://make.com/scenario-3-link/?iteration=2
  7. S3 calls S1 with: https://make.com/scenario-1-link/?iteration=3

In your webhook, you can extract the iteration value and in your router, you put a filter based on that value.

So here is a sample blueprint. You can put in the correct URL in the HTTP modules to see how it works and if that’s what you want. I used the URL of my scenario so it calls itself but you can put any URL.

blueprint-2024-08-09-1024.json (30.2 KB)

L