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?
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?
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.
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.
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.
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.
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.