I have a workflow that has a switch to define a couple of variables and then two branches of the switch flow to the same Loop node (without being merged). This morning only the first branch was executed, the second branch simply went straight to done without going through the loop. Is that by design? What’s wrong with my Workflow?
n8n will struggle keeping track of the correct loop iteration in such a scenario. Your first branch will pass on one list of items to the Loop node which it will then run through. Once the second branch arrives, the loop will have already completed the expected amount of loops determined when it first executed.
To avoid this you can use Merge nodes in “Append” mode to transform multiple item lists into one list, like so:
This way, your loop would run for every single item without having to write a custom reset logic.