Split In Batches node currentRunIndex example — n8n Workflow

Low complexity Trigger5 nodes🏷️ Miscellaneous👁 2,768 viewsby Harshil Agrawal

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

On clicking 'execute'FunctionSplitInBatchesIFSet

Workflow Preview

O
On clicking 'execute'
F
Function
S
SplitInBatches
I
IF
S
Set
5 nodes5 edges

How it Works

  1. 1

    Trigger

    The workflow starts with a trigger trigger.

  2. 2

    Process

    Data flows through 5 nodes, connecting function, if, manualtrigger.

  3. 3

    Output

    The workflow completes its automation and delivers the result to the configured destination.

Node Details (5)

ON

On clicking 'execute'

manualTrigger

#1
FU

Function

function

#2
SP

SplitInBatches

splitInBatches

#3
IF

IF

if

#4
SE

Set

set

#5

How to Import This Workflow

  1. 1Click Download JSON button on the right to save the workflow file.
  2. 2Open your n8n instance. Go to Workflows → New → Import from file.
  3. 3Select the downloaded split-in-batches-node-currentrunindex-example file and click Import.
  4. 4Set up credentials for each service node (API keys, OAuth, etc.).
  5. 5Click Test Workflow to verify everything works, then activate it.

Or paste directly in n8n → Import from JSON:

{ "name": "Split In Batches node currentRunIndex example", "nodes": [...], ...}

Integrations

functionifmanualtriggersetsplitinbatches

Get This Workflow

Download and import in one click

Download JSONView on n8n.io
Nodes5
Complexitylow
Triggertrigger
Views2,768

Created by

Harshil Agrawal

Harshil Agrawal

@harshil1712

Tags

functionifmanualtriggersetsplitinbatches

New to n8n?

n8n is a free, open-source workflow automation tool. Self-host it or use the cloud version.

Get n8n Free →

Related Miscellaneous Workflows