Templates / Split in batches node noItemsLeft example

Split in batches node noItemsLeft example

Needs changes

by Harshil Agrawal ✓ · 6,670 views · created 2021-03-19 · Engineering

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: Function (legacy). 1 breaking item(s) found. Static check, last run 2026-10-19.

What to replace before upgrading

Removed in 3.0Replace with
Function (legacy)
Function
Code node, mode 'Run Once for All Items'

Nodes used (5)

What it does

This workflow demonstrates how to use noItemsLeft to check if there are items left to be processed by the SplitInBatches node. !workflow-screenshot(fileId:453) 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 check if all the data by the SplitInBatches are not processed or not. It uses the expression {{$node"SplitInBatches".context"noItemsLeft"}} which returns a boolean value. If there is data yet to be processed, the expression will return false, otherwise true. Set node: This node prints a message No Items Left. Based on your use-case, connect the false output of the IF node to the input of the node you want to execute, after the data is processed by the SplitInBatches node.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.