@taylorpeter55 you can use the Variable Condition Loop End node to stop a loop once a condition is met. You can use temporary table to collect the results you already have.
As an alternative you can try and build something with a Recursive Loop and define an end condition.