Hope you are happy and Healthy!
The problem I am facing is to preserve the Index while using SplitInBatches and If Node together,
I have prepared a scenario for the demonstration but let me give an overview first.
I am Reading data from google sheet or say from MySQL it’s huge data and I use SplitInBatches to break it down to batch of 10. Then I make an API call with HTTP node which may return 200 or any other code depending on data request i make.
After this I use IF node to check if result was 200 OK or anything else thus dividing the batch in random size(based on response of HTTP). Now I need to obtain the input value from Split in Batches which corresponds to the right index of the request so that I can mark in my databsae if API call for a row was success or Failure.
And at this point I fail as the index is no longer preserved when using IF node.
I have prepared the sample workflow to demonstrate the same.
Please check the Outcome from Set and Set1 under column “original” and compare it with the Input given to the SplitInBatches, you will notice the same index is repeated over and over for true and false both Set nodes.
- n8n version: 0.163.1
- Database you’re using (default: SQLite): MySQL
- Running n8n with the execution process [own(default), main]: Not sure what this means
- Running n8n via [Docker, npm, n8n.cloud, desktop app]: npm