Split in batches node currentRunIndex example
This workflow demonstrates how to use currentRunIndex to get the running index. !workflow-screenshot Function node: This node generates mock data for the wor...
🔌 Nodes & Integrations Used (1)
📖 Implementation & Setup Guide
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 `{{$node["SplitInBatches"].context["currentRunIndex"];}}`, which returns the running index.
**Set node:** This node prints a message `Loop Ended`. Based on your use-case, connect the false output of the *IF* node to the input of the node you want to execute if the condition is `false`.
⚡ How to import this workflow into n8n:
- Click the Direct Download JSON button above to save
Split in batches node currentRunIndex example.json. - Log in to your n8n Cloud or self-hosted n8n instance.
- In your workflow canvas, click the menu in top-right and select Import from File (or paste the JSON directly).
- Configure your credentials (e.g. API keys, database URLs) in the corresponding node settings.
- Click Execute Workflow to test and switch to Active!
Related General Automation Workflows
View All in General Automation →Generate Application Copy
Production-ready n8n automation template for Generate Application Copy built by AhiXLight. Seamlessly connects Execute Workflow Trigger, OpenAI with 4 configured nodes.
2-way sync Google Contacts and Notion
Sync your Google Contacts with your Notion database. You can filter contacts by label or sync all contacts. All contact information is kept in sync between G...
2D Image to 3D Model Automation
Production-ready n8n automation template for 2D Image to 3D Model Automation built by AhiXLight. Seamlessly connects HTTP Request, Google Sheets, Google Drive with 17 configured nodes.
2 way sync assignments completion between Canvas LMS and Notion
Syncs assignments and completion states to and fro between Canvas LMS and a Notion database. Automatically triggers every 2 hours during the schoolday by def...