Challenge understanding the Loop Over Items and how it works

Hello All,
I am brand new to n8n. Have been using Make.com and Pabbly.com for our automations. And starting to look at n8n now. I think I got most of the code working, but I’m have a challenge with the Loop over items.

This is our process in Make that we are re-creating in n8n.
Make has a function called an Iterator (Iterator is a special type of module that converts an array into a series of bundles. Each array item will output as a separate bundle).
=> https://www.make.com/en/help/modules/iterator

I’m sure it something simple but I can’t seem to see how to resolve it.
I have 2 items going into the Loop Over Items and I’m expecting to write 2 records to Airtable. But I’m only getting 1 record written.

I have attached my workflow.

Would someone please be so kind as to advise me what I’m missing.

Thanks so much,
~ Pat

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.57
  • Database (default: SQLite): Default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Windows 11

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

If I paste my code I get a 403?

type or paste code here
1 Like

Welcome to the community @pat_shanks !

Tip for sharing information

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

That implies to any JSON output you would like to share with us.


It doesn’t look like you need to use Loop in your n8n workflow. Without the Loop each node works on each item (which corresponds to a bundle in Make) separately and automatically, no need for an explicit iterator.

Using Loop in your case doesn’t really play any role unless you want to introduce a delay between the first and subsequent API calls to the OpenRouter. The Loop is typically used for that purpose (delays) to ensure the threshold on the API is not breached. Its purpose is somewhat different from Make’s iterator as n8n does iteration automatically by processing each item by each node. That is, each node works on each item before passing over the outcome of all the items processed to the next node.

Though I still wonder what “Code_Stringify_Ideas” node does. Perhaps you need to aggregate your items first to use the aggregated result in HTTP Request node (make one item our of two)? It important to node that in order for Loop to complete (iterate over each item), the last node in the Loop has to return something back to the Loop node with each iteration. Say, if “Airtable_All ideas” or any node in the loop does not return a value (or returns an empty value) the Loop will terminate prematurely (without an indication of a failure). Yet again, I believe you can get by without the Loop node.

1 Like

I have tried to load my workflow into this message thread but I keep getting a 403.
Any idea how to get my code uploaded? Did a video of the problem below.

=> https://www.loom.com/share/69aa9e1701344dfdab2a7c7bc0d2877f

1 Like

Hello @ihortom thanks for getting back.

I’m still have challenges trying to post my code to this message board as I keep getting 403. I have upload the workflow to AWS S3 if need it for review.
=> https://s3.us-east-1.amazonaws.com/s3.patandlorna.com/shared/TCC_Ideas_Improver_V3.json

Here is an image of the full workflow.

My challenge is that one record coming in from Airtable. Has 2 fields that could have 1-n (in this test 2 records) pieces of information that I need to loop through and send to OpenRouter.

These are in the Code_PackagePromptTempalte (Different prompts to send to OpenRouter)
Field 1: promptUsed
Field 2: packagePromptTemplate

The Code_Stringify_Ideas was put in place as I keep getting “JSON not valid” when sending to OpenRouter.

So maybe I’m approaching this wrong for the way that n8n works. I’ll look at aggregate as you suggested or maybe an IF loop.