I’m currently working on a workflow where I need to process each item in an array individually, introducing a specific delay between processing each item. Specifically, I have an array containing multiple items, and I want to:
Process Item1
Wait for a defined period (e.g., 3 minutes)
Process Item2
Wait again
Continue this pattern for all items in the array
I attempted to achieve this using the “Split In Batches” node in combination with the “Wait” node inside the loop. However, I encountered an issue where the workflow waits until all items have been processed before moving to the next step, rather than processing each item individually with the desired delay in between. It seems that the Batches-Node wait till all items went through the loop before it generate an Output (wich is an Array of all items)
Here’s what I’ve tried so far:
Split In Batches Node: Set the batch size to 1 to process one item at a time.
Wait Node: Placed inside the loop branch after to introduce a delay between processing each item.
This will end in a loop with the desired delay between the items, but on the done-branch the output is again one array with all items.
Goal: I want to process each item of the input (array with X items) and process them individually as output with a delay of xx time between each item to create an output for each item.
Example:
Input: [item 1, item 2, item 3, …]
Output: [item 1] wait xx [item 2] wait xx [item 3] wait xx …
My question to the community:
How can I configure my n8n workflow to process each item in an array individually, with a specified delay between processing each item? Is there a recommended approach or best practice to achieve this functionality?
Any guidance or examples would be greatly appreciated.
I’m not sure i fully understand your problem. Bu if you place the entire workflow you want to have an delay between where the Replace Me block is, including the delay, does that not achieve what you want. You don’t need anything on the done-branch.
thanks for your example! However, as far as I understand, it’s not generating any output in this case. Your example loops through all items in my list, but since the done-branch isn’t used, there’s no output. And if you do use the done-branch, the loop node will wait until all items are processed before proceeding (output: an array containing all items).
The only thing I haven’t tested yet is the split-out node. But I have a limit node right before the loop node, and if I use a split-out node right after it, the output from both nodes (limit and split-out) ends up being exactly the same — an array containing all items.
What I’m trying to achieve is that each item in the workflow gets processed individually, starting from the loop node (or another node). The workflow is a sub-workflow, and I’d like the output at the end of the workflow to look like this:
output-item1 – 30 sec. pause – output-item2 – 30 sec. pause – … – output-lastItem
Unfortunately, I haven’t found a way to make this work yet.
Could you give us an example of your current workflow?
Following @xqus suggestion, if you loop the entire workflow and add a 30 sec delay on the end, it should work as you are describing, the loop will run trough each input, process it, get the output and wait 30 seconds before looping thought the next one.
So you can process everything without the need to ever touch the done branch.
Hi and thx for your suggestion, but that’s what I tried.
I’ve an array with several items as input into the loop-node, then they went through the loop in wich I’ve a wait-node and in the end the item get back to the loop-node. But then the loop-node is waiting till all items went through the loop and is collecting them till it generates an output of an array with several items in it.