I’m trying to implement this logic:
- I have text that needs validation
- If text is correct → continue flow
- If text is NOT correct → fix it and validate again
My current flow:
ChatGPT Result → HTTP Make a request (validation) → (if correct) END
↓ (if not correct)
Repeater
ChatGPT Fix
HTTP Make a request (validation)
↓ (if not correct)
Repeater
↓ (if correct) - END
The problem:
- The Repeater module will ALWAYS execute all configured repetitions (example: if I set 3 repetitions, it will always do all 3)
- I need the Repeater to stop when the validation is successful (“not Banned”)
- I can’t find a way to break the Repeater cycle based on a condition
Questions:
- Is there any way to break the Repeater when a condition is met?
- Or is there a better alternative to implement this “repeat until correct” logic?
Here is my scenario, I need to repeat the highlighted area only until the filter condition is met.
@Florencia_Requejo
It may be better to use Routers and Filters instead of a Repeater to branch according to conditions.
If errors occur in the HTTP Request module, it may be a good idea to add error handling using the Error Handling module like a below image.
Thank you, and yes, I thought about that option, but that is a “finite” road, meaning if it keeps failing after 2 attempts it won’t keep fixing it.
I need something more “organic” to keep reviewing the content until it is fixed. The repeater works perfectly for this, but only if it has a way to exit it. As for the repeater, I can set it to repeat a lot of times, but then it will run all those times, If there was a way to exit the repeater after a condition is met, that would be perfect.
Add a filter between the chatGPT and HTTP
1 Like
Thank you for your feedback, but the HTTP module is the one that determines if the operation should stay or break the circle. So, I need the filter after the HTTP. And even if I set it that way, the repeater would keep running until the set amount of repeated is completed. I need something to break the cicle.
@Florencia_Requejo
I have found this to be impossible based on the previous conversation.
This is because Repeater does not have a function like the Break statement in programming languages.