Why does the 'Completed' output of my while loop trigger ten times?

This is only a segment of my code, I was thinking the rest of it is irrelevant. I am only concerned about the second while loop.

The ‘completed’ output of it seems to run ten times, the Add Instance node was just put there as a test, I would expect a single tree mesh to be spawned whenever the loop completes, but, it places exactly ten trees every time the loop is run.

I can also see that the code inside the loops runs fine (no infinite loops) and my “coordinates” variable is being incremented properly.

And I can also see that all ten times the loop completes the “coordinates” variable is x=8, y=5. Which is exactly what it’s supposed to be when the loop completes, it’s just not supposed to complete ten times

I suggest you put a print statement between the two while loops and make sure that this print statement only happens once. To your point, the while loop completed, by itself, should only happen once if the while loop is called only once.