I’m trying to create a modified version of the midjourney api image generator.
Basically i want to use the repeater (if you know a better module feel free to suggest) to loop through the sleep and HTTP request until the HTTP request throws back a value of finished.
When it’s finished i want the flow to continue.
Unfortunately, at the moment the repeater still goes through each iteration.
Does someone have a suggestion on how i can do that?
It’s basically a while loop. While status processing continue checking until value = finished.
If possible, after making your initial request, it would be better to specify a callback URL so that the service can trigger a separate scenario via webhook when it’s done doing what it’s doing.
If you search the community for “while loop” you should be able to find some other suggestions as well.
Another option is to use another helper scenario that’s capable of calling itself.
Your original scenario would end after the initial call, then use HTTP module to run the helper scenario.
After your helper scenario’s trigger module (let’s say Webhook), add the HTTP call followed by a router.
If the return is NOT finished then add a delay, then call itself via HTTP module.
if the return IS FINISHED, then proceed with the rest of your original scenario.
You could even use more than one, if you have a Make subscription (free tier max 5 minutes per scenario run).
Method 2 — difficulty level: ???
This other method allows you to check multiple times at shorter intervals, because you “throw” an error to break from the repeater and end the scenario when successful/completed.
Thanks a lot for your help. It looks like making a while loop in make is truly not possible. Even though you suggested good workarounds it would mean that each task would take a lont time to complete. I guess i’ll just have to make a python script webhook that does it for me. It’s a bit disappointing that the simple while loop isn’t possible.
Best,
Kierin