Loop over item abnormaly stops without explicit error after 2 occurences

Hi,

I searched a lot on the community and i sometimes think i saw some part of my problem but i haven’t found a appropriate solution for this. Sorry if it already have been answered before, maybe i didn’t understood everything (it’s my first month of n8n experimentations).

problem description

I’m trying to make a loop on a web service with many API key linked to several communities of this website in order to do the same requests on each community . I don’t want to make one workflow for each API key.

To do so, i’ve tried to enumerate my API keys (here with 7 in the code block and make a loop over the items. It perfectly works for the two first occurences. At the end of the second iteration, the workflow stops as if there wasn’t a third one. The same behaviour is observed regardless of the number of items handled in the web requests, the time of each iteration, the number of items… every time, two loops (community) iteration before stopping evything.

The previous problems i saw reading the others topics were often occured by nested loops or multiple merge, but here, i tried to simplify the workflow at its maximum to avoid any problem and unfortunatly ,it don’t work .

any help would be appreciated :slight_smile:

error message and output return

  • no error message at all
  • Correct node processing during the 2 first loop iterations. Then the workflow stops as if no other input have been provided

workflow detail example

global workflow:

“Split by community API output”
No anomaly at all. parameters are also correctly called on “Get opened alerts node”

No anomaly observed on the two first iterations (good transmission of the community name and api key, consistent data for each community…)

Information on your n8n setup

  • n8n version: latest (1.105.3)
  • Database: default
  • n8n EXECUTIONS_PROCESS setting: default
  • Running n8n via : Docker
  • Operating system: Ubuntu

Thank you for your help.
Best regards.

1 Like

Hi @codeyourweb,
please try this:
In a loop-based workflow, the True branch of the IF node will complete its actions before the next iteration starts. Ensure the data is valid for each iteration and that the conditions for continuing the loop are correctly set. If it doesn’t work, we can explore another solution.

1 Like

Hi,

Sorry for this very late reply. You were true! It was a mistake caused by the API that sometimes return a value and sometimes not. But i wasn’t checking if the value exists in the if, only comparing this value (with a null value when it doesn’t worked) with another.

Just a question: why there wasn’t any error caused by this missing object? Is there a “more verbose” mode to detect this kind of errors?

1 Like

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