Problem with Nested Loops Skipping Items After Airtable Deduplication in n8n

Describe the problem

Hi everyone,

I’m trying to scrape leads from a website using Firecrawl. There are around 160 pages with 25 entries per page.

Because the loading time was extremely long, I decided to use a Loop Over Items node to go through the results in smaller chunks.

After scraping, I want to deduplicate the leads against the ones already stored in our CRM (Airtable).

I tried using a formula or the Split Out feature to perform a search in Airtable directly, but I keep getting an error.

That’s why I’m now using a second Loop Over Items node to handle each scraped lead individually and check it against Airtable.

However, once the second loop finishes and the flow returns to the first loop, the output seems to go directly into the “done” branch of the outer loop, without processing the remaining items properly.

As a result, from the second iteration onwards, none of the remaining leads are being synced into Airtable anymore.

Any idea what’s going wrong or how to fix this logic?

Thanks in advance!
Simon

Please share your workflow

Information on your n8n setup

  • n8n version: 1.95.3
  • Webversion

This is a shot in the dark, but does the second loop output data, when it’s ‘done’?
Checking ‘always output data’ might help.

Hi there! If both loops will always receive only one item as input, you just need to enable the reset option. This ensures that each time the loop receives input, it follows the loop branch. Also, make sure to include a valid termination condition using an IF node to decide whether to continue looping or exit.

For more details, please refer to the Loop Over Items documentation.