mirror of
https://github.com/n8n-io/n8n-docs.git
synced 2025-11-20 17:48:34 +00:00
| .. | ||
| Function_node.png | ||
| README.md | ||
| RSSFeedRead_node.png | ||
| SplitInBatches_node.png | ||
| workflow.png | ||
| permalink | description |
|---|---|
| /nodes/n8n-nodes-base.splitInBatches | Learn how to use the Split In Batches node in n8n |
Split In Batches
The Split In Batches node saves the original incoming data, and with each iteration, it returns a predefined amount of data. This node can be used to loop through the data.
Node Reference
- Batch Size: The number of items to return with each call.
- Options
- Reset: If set to true, the node will reset.
Example Usage
This workflow allows you to read RSS feed from two different sources using the Split In Batches node. The Split in Batches node is needed in the workflow since the RSS Read node only processes the first item it receives. You can also find the workflow on n8n.io. This example usage workflow would use the following nodes.
The final workflow should look like the following image.
1. Start node
The start node exists by default when you create a new workflow.
::: v-pre
2. Function node
- Paste the following JavaScript code snippet in the Function field.
return [
{
json: {
url: 'https://medium.com/feed/n8n-io',
}
},
{
json: {
url: 'https://dev.to/feed/n8n',
}
}
];
- Click on Execute Node to run the node. :::
::: v-pre
3. SplitInBatches node
- Set the batch size to
1in the Batch Size field. - Click on Execute Node to run the node. :::
::: v-pre
4. RSS Read node
- Click on the gears icon next to the URL field and click on Add Expression.
- Select the following in the Variable Selector section: Nodes > SplitInBatches > Output Data > JSON > url. You can also add the following expression:
{{$node["SplitInBatches"].json["url"]}}. - Click on Execute Node to run the workflow. :::



