Loop: different results & not finishing

Hey community, I have spotted some loop-result inconsistencies that havent been covered in this forum, and wanted to get your thoughts on it. My flow is simple: i have 3x urls in an array, which i split out and then i have a loop to find news articles in these 3x urls.

  1. Loop ending VS no-end: I found that if I end the loop on a ‘no operation, do nothing’ node, the result is different from if i let the loop end without such a node. Interestingly enough the former gives me only 6 results, while the latter gives me 8 results. I usually read that ending the loop on a ‘no operation’ end is usually better, but given it gives me less results, is this ending actually worse than not having an end?

  2. Loop not finishing: this is a continuation of the previous loop. I added a few urls, 10x in total. But my loop runs only 4 times. Any thoughts what could be causing this? SOme trobuleshooting that i did

  • i dont think its my n8n version 1.89.2
  • there is no loop limit
  • whether i have an '‘no operation, do nothing’ ending to the loop or not doesnt change the loop not ending.
  • I was thinking its maybe the type of urls
  1. main url / 1 & 2 are subdomains / 3+ are all paths → maybe the loop doesnt run different paths?

Appreciate your help!

The most possibility is here

There is nothing to split and workflow stop.

You can try to activate this option always output data and try again!

2 Likes

Darrell, thanks so much! Taking out the ‘split node’ fixed my loop issue indeed!

May I trouble you with a very silly, semi-related question: the use of the ‘split node’ before was to take the news articles that open AI node found (they are in an array), split these articles into seperate objects, so that each of the articles / objects can be pasted into google spreadsheets. Now, without the split node, the articles remain in an array and only the first articles gets carried over into google spreadsheets. (see screenshot). Do you know how i can paste all articles from that array into google, without splitting them into seperate objects? Sorry for continuing to trouble you.

1 Like

I think the Split node should be remained.

But the problem is

If openAI response empty acquisitions and if you don’t check the output anyway. The workflow will stop when it’s empty. But you will want the workflow continue even if one of the loop have the empty acquisitions

1 Like

Understood, thanks darrell

thak you too.

Hey Darrell, i now kind of ended up with my original quesiton: now that the split is back in and i set the loop settings to ‘always output data’, i have 10 urls, but only 4 loops?

Got it, here’s a clearer version:

Maybe I didn’t explain it well.

Both the Split node and the Google Sheet node should have the “Always Output Data” option enabled.

The problem seems to be that when the Split node has nothing to split, it stops the workflow.

No need to enable this option on the Loop Over Items node.

Take a closer look at here.

Split out - execute 4 times
Sheet - only execute 3 times.

It means the Sheet node didn’t get input from Split.

1 Like

Ah understood, sorry for misunderstadign earlier. That makes sense and it works! Cheers man!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.