I have a problem with a workflow, where I have a loop and some nodes that query mongodb, it works perfectly, but when I link the last node back to loop is where starts the problems. The nodes that is marked to “Always Output Data” fires without being fired by previous node, as seen in the image bellow:
What is the output of the nodes that execute out of order? The ones with “Always output Data”
Plus, do you get any errors or is the execution logged as running successfully?
Trying to recriate the issue, but haven’t managed to hit the same bumps so far.
The output is the document from my mongodb, when it’s execute successfully, but, when it execute out of order, it returns an empty json, the mongodb operation is not executed, only returns the empty data.
I didn’t get any errors on log when execute it succesfully.
But do you get any error message when the execution fails?
If you are self-hosting, I suggest setting up some logging variables, if you haven’t already, to get a better glimpse at the error. Logs environment variables | n8n Docs
I solved it as follows, I create my own custom node for mongodb that returns empty json if not found any documents, then I can turnoff the “Always Output Data” from the mongodb nodes. It works propertly inside a loop now
Thanks for sharing the solution you found!
Are we ok to mark this as solution so other users that might be facing the same issue can find the answer more easily?