Learn how to use the 'noItemsLeft' context variable within an n8n workflow to accurately detect when the Split In Batches n8n node has finished processing all items.
Download this n8n workflow template and start using it instantly.
This n8n workflow template demonstrates a powerful technique for managing flow control when processing data in batches. When dealing with potentially thousands of items, knowing exactly when the final batch has completed is crucial for initiating cleanup actions, notifications, or subsequent process steps. This n8n node demonstration leverages the specific context property noItemsLeft exposed by the Split In Batches n8n node. By checking this variable in a downstream IF n8n node, the n8n workflow ensures that the final completion action executes only once, after all items have been successfully processed.
This n8n workflow template is designed specifically to showcase the internal mechanics of the Split In Batches n8n node.
Function n8n node generates 10 sample data items (simulating a large input dataset) to feed into the batch processor.Split In Batches n8n node takes these 10 items and is configured to process them in batches of size 1.IF n8n node. This crucial n8n node checks the expression {{$node["SplitInBatches"].context["noItemsLeft"]}}. The value of this context variable becomes true only during the final execution cycle, indicating that the source data stream has been fully consumed by the Split In Batches n8n node.IF condition is true (meaning no items are left), the n8n workflow executes the final Set n8n node, which sets a confirmation message. If the condition is false, the processing loop continues implicitly until all batches are exhausted.To use this flow, follow these steps to import this valuable n8n template:
IF n8n node in the execution log to see when the noItemsLeft condition evaluates to true. Manual Trigger (On clicking 'execute'): The starting n8n trigger for testing the n8n workflow structure easily.
Function: Generates 10 placeholder items (i=0 to i=9) to simulate a payload that needs batch processing. This custom code scripting allows for quick flow testing.
Split In Batches n8n Node: Core flow control n8n node. It splits the incoming 10 items into batches of size 1, cycling through the subsequent nodes until all items are processed. This n8n node makes the critical noItemsLeft context variable available.
IF n8n Node: The decision point. It checks for the batch completion status using the expression: ={{$node["SplitInBatches"].context["noItemsLeft"]}}. This is the key to accurately detecting the end of the batch operation within this n8n workflow.
noItemsLeft is true). It sets a simple message: "No Items Left," confirming the successful termination of the Split In Batches loop.Deploy this powerful n8n workflow to automatically scrape GitHub for top developers, score them using a custom AI agent (Gemini), and save ranked leads to Google Sheets. Use this n8n template for talent acquisition.

Use this powerful n8n workflow to automatically sort your Gmail inbox. It utilizes the GPT-4o n8n node to classify emails as ‘Action Required’ or ‘No Action,’ applying labels and archiving messages.

Build a powerful social media sentiment analysis dashboard using an n8n workflow. Scrape Twitter, Reddit, and LinkedIn, analyze sentiment via custom AI, and send critical alerts to Slack.

Implement robust A/B testing for your AI agent prompts using this powerful n8n workflow. Randomly assign new chat sessions to either a baseline or alternative prompt using Supabase for persistent tracking.

Use this robust n8n workflow to automatically scrape employee demographic review data from Glassdoor using ScrapingBee, leverage OpenAI to perform statistical analysis (Z-Scores, Effect Sizes), and visualize potential workplace discrimination patterns via QuickChart. This is a powerful n8n template for HR and researchers.









































