Split In Batches node currentRunIndex example — n8n Workflow
Overview
This workflow demonstrates how to use currentRunIndex to get the running index.
Function node: This node generates mock data for the workflow. Replace it with the node whose data you want to split into batches.
SplitInBatches node: This node splits the data with the batch size equal to 1. Based on your use-case, set the value of the Batch Size.
IF node: This node checks the running index. If the running index equals 5 the node returns true and breaks the loop. The node uses the expression {
Nodes used
Workflow Preview
How it Works
- 1
Trigger
The workflow starts with a trigger trigger.
- 2
Process
Data flows through 5 nodes, connecting function, if, manualtrigger.
- 3
Output
The workflow completes its automation and delivers the result to the configured destination.
Node Details (5)
On clicking 'execute'
manualTrigger
Function
function
SplitInBatches
splitInBatches
IF
if
Set
set
How to Import This Workflow
- 1Click Download JSON button on the right to save the workflow file.
- 2Open your n8n instance. Go to Workflows → New → Import from file.
- 3Select the downloaded
split-in-batches-node-currentrunindex-examplefile and click Import. - 4Set up credentials for each service node (API keys, OAuth, etc.).
- 5Click Test Workflow to verify everything works, then activate it.
Or paste directly in n8n → Import from JSON:
Integrations
Created by
Harshil Agrawal
@harshil1712
Tags
New to n8n?
n8n is a free, open-source workflow automation tool. Self-host it or use the cloud version.
Get n8n Free →