Thank you for your help. I really do appreciate it.
My first rhetorical question is, if this is happening because the merge node did not receive data on all inputs, why is that not a requirement when the loop is not complete? It’s the same data, so the same inputs aren’t receiving data. That makes no sense.
It seems to me the merge node wouldn’t know if it’s a loop or not.
I will see what I can do with the methods you’ve outlined. I have tried building the JSON all in one edit node. As I recall, both using JSON and Manual Mapping had issues. But it’s been a while. What I have builds the JSON just fine, as long as it’s not in a loop. The weird part is, the loop can be in the same workflow as the merge node, or from the calling flow. Either way it stops.
I assuming the reason is with the node execution chain. You see that when the loop is not looped, everything is ok. But you dont’t see in which order the nodes have been executed. And that’s not the issue as n8n doesn’t care about it. It simply executes whatever it may. But when you have a loop, the order is important. All connected nodes must be passed before entering the next loop
However if we change the execution order to legacy one, the first loop will work and breaks on the second one (there is no home phone number for user there)
That makes sense, It is breaking because the merge node is not getting all the inputs so on the first run everything is there and it is all good which is why it also runs when not looped but on later loops if the data is missing it won’t have the input so won’t output.
We should probably add a feature where if an input is empty we just output a null or undefined value that would allow workflows like this to work without needing manual data validation steps in the flow.