Automatic flow with batch size loop

The goal for this project is to Read data from Gsheet, filter input through IF.
(This file contains the orders of the clients.)
Afterwards, I have to create x number of contact attributes in SIB for each order, and fill them with “N de commande” that it’s a item field.
Looped for each contact in the file.My problem is:
I’ve create the 2 process to create contact attributes base on the number of the orders, and fill it with another node like the screenshoot

So the I split the input with all the Items(contacts) in 1 per run, after
An IF like a counter, using the $runIndex parameters

If i leave the flow like that, It work, but of course I have to make it AUTO and to Loop it untile the contact are finish.
So if I connect the “True” output of the last IF to the Split in baches node, it enter in a loop and start to create infinite contact attributes

Maybe the explanation could be not so clear, so If you have question let me know, this is the code for the n8n project if you want to check

Hey @Gabriele_Bracciali,

Can you share the output of the Set node? If it is easier you could also only pull out the first 10 items so we can give the workflow a test run and see what is happening.

When you get the infinite loop is it using the same data each time? Does it ever move to the next if node as well?

The output should be something like that, with more data, but I left only the value that we need.

[
  {
    "Tél Mobile": "sss",
    "Today Date": "1/11/2023",
    "matchingItems": [
      {
        "N° de commande": "421-4784",        
        "Today Date": "1/11/2023"
      },
      {
        "N° de commande": "421-4784",        
        "Today Date": "1/11/2023"
      },
      {
        "N° de commande": "421-4784",      
        "Today Date": "1/11/2023"
      },
      {
        "N° de commande": "421-4784",        
        "Today Date": "1/11/2023"
      },
      {
        "N° de commande": "421-4784",        
        "Today Date": "1/11/2023"
      },
      {
        "N° de commande": "bc21/421-2969",        
        "Today Date": "1/11/2023"
      }
    ]
  }
]

I get stuck in the loop in the first 2 block of node “If and HTTP”, and start to loop and to call the endpoint

Update:

I’ve edit this section adding this sort of counter to avoid the loop, but it doesn’t look working well…
It’s right to use the node “Set6” like function to increment the counter in the node “Set5”?

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