data is entering the loop after I split it. (in this case it was 10 items)
it runs the loop and outputs 300+ items
after the loop I have an aggregate node set to all items into one and also execute once
but no matter what, it runs 10 times (depends on the input from the split node before the loop
I just want data down to a single item after the loop, i don’t care how it is accoimplished. if there is 10 items going into the loop, how do I reduce that to 1 after the loop is run?
I have tried filter, set, aggregate, all set to execute once, and nothing drop it down to 1 item
Hi @djjace Welcome to the community!
I think linking your Aggregate node to the done output of Loop Over Items (not the loop output) and set it to “All Item Data (Into a Single List)” might work here, so after all iterations finish it emits a single item containing all processed items in one array. Repeat through products in total.
not quite sure I follow. I have the aggregate after the looping is done, but from how I am reading your post it would suggest there is another output I could link it to? I only have “loop” and “done” coming from the loop over items node
Can you share your workflow again after running it and pinning the data so we can see is there something wrong between it? Currently i have tested your flow with some random data i have generated and it seems to be working fine.
I have tried everything I can to get it to 1 item.
If I have a aggregate node that has 12 items going into it, and I say “all items into one list” and have the execute once option toggled, I should not get 12 items as output, right?
ive done this a hundred times on other workflows and never had this issue before
I can guess what’s wrong with this workflow, the Split node inside the loop outputs two branches, and each branch loops back, that explains why in the end the Aggregate node doesn’t return a single item..
The solution would be to use a Merge node so that we get only one loopback branch, keeping the loop logic correct,
hi @djjace I believe the wf json you shared and that I ran is not exactly the one you’re using because in my wf execution it goes to the node “insert rows“ and output 30 items :