I’m currently working on a workflow where I need to implement something like a conditional loop, similar to a while loop in traditional programming.
Use Case:
I have a list of entities, and for each entity, I need to make an HTTP call repeatedlyuntil a favorable response is returned (e.g., a status or flag in the response indicates success). Once a favorable result is received, the loop should break out of the loop, and the workflow should move to the next node.
Question:
I’m aware that this kind of pattern can be implemented using AI Agents orchestrated through LLMs, but I’m curious— Is there a way to do this using standard n8n nodes/triggers, without relying on an AI Agent Node?
Has anyone implemented a loop with conditional exit like this using native logic in n8n (e.g., Function, IF, Set, or Wait nodes)?
Any examples or pointers would be very helpful.
In my case, i am having 6 entities from the previous HTTP node. For these 6 entities i want to invoke the next HTTP Node, which is essentially my in-house outlier detection API. I want to invoke the Outlier Detection HTTP node for these 6 entities one by one until one of them gets a “Not Outlier” status.
Hope this makes things clearer. Do share any insights regarding implementing the same.
In the meantime, I’ll try your solution and update here…