Hello community,
I’ve been struggling with this for days. Can anyone help me?
It’s actually a simple task: I need to retrieve RSS messages and save them to a database.
The URLs are stored in a database table, and the retrieved messages should then be saved to another database table.
The problem occurs when saving the messages. Example: The Select node returns five records in the following format (feed name, URL, language). The RSS Read node returns 40 messages. With the Insert node, I have to save the messages together with the feed name and language. Unfortunately, I don’t have the assignment, and I can’t see which message comes from which feed request.
Solution 1: I can now replace the Select node with a Set node that sets the URL and other information. Then copy these nodes five times and adjust the Set node accordingly. That’s how it works at the moment.
Solution 2: I tried to teach the RSS Read to attach information to the message. The only possible option parameter is “Custom Fields.” Unfortunately, I couldn’t get that to work.
Solution 3: Use a Loop Over Items (split into batches). Execute one loop per data record (item).
Unfortunately, this does not work either, as an endless loop begins after the first loop. Only the first URL is ever executed, even in the second or subsequent loops. I have found many examples where this is shown as a solution to my problem. However, the examples do not work for me either.
Solution 3: Code node + If node instead of loop node. In the code node, I tried to replicate the function of the loop node using Java. Later, I added a set node to the loop. This set node sets a field LastIndex = # current item. When I execute the first loop during a debug run and open the “code loop,” I can see LastIndex = 0 in the input. As soon as I press execute, the value disappears and the Java code cannot see it. Therefore, the first loop is started again in the Java code. The same as with the loop node.
I have tried this on two servers. Therefore, I think there is a bug. Or am I doing something wrong?
I really help here: The workflow works because I copied it five times. However, the table with the URLs will grow, and it doesn’t make sense to always have to adjust the workflow.
n8n version 1.122.4
Self-hosted on Docker in Debian
Loop Over Items (Split into Batches) node version 3



