Split in batches node noItemsLeft example
Needs changesWhat this workflow does
This workflow has 5 nodes and runs manually, when you click “Execute workflow”. It uses only n8n's built-in nodes.
How it runs
Trigger: Manually, when you click “Execute workflow”.
- Function: runs custom JavaScript (legacy Function node)
- SplitInBatches (Loop Over Items (Split in Batches)): loops over the items in batches
- If: checks a condition and branches into true / false
- Set (Edit Fields (Set)): sets or maps fields
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- Function (legacy) in Function: replace with Code node, mode 'Run Once for All Items'.
Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).
Published 2021 — 25% of templates published before 2025 need changes for 3.0. See how template age affects 3.0 readiness →
| Removed in 3.0 | Replace with |
|---|---|
| Function (legacy) Function | Code node, mode 'Run Once for All Items' |
Nodes used (5)
- Manual Trigger
n8n-nodes-base.manualTrigger - Function
n8n-nodes-base.function - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - If
n8n-nodes-base.if - Edit Fields (Set)
n8n-nodes-base.set
From the author
This workflow demonstrates how to use noItemsLeft to check if there are items left to be processed by the SplitInBatches node. Function node: This node generates mock data for the workflow. Replace it with the node whose data you want to split into batches.…