diff --git a/docs/nodes/nodes-library/core-nodes/SpliInBatches/Function_node.png b/docs/nodes/nodes-library/core-nodes/SpliInBatches/Function_node.png new file mode 100644 index 000000000..0117297e0 Binary files /dev/null and b/docs/nodes/nodes-library/core-nodes/SpliInBatches/Function_node.png differ diff --git a/docs/nodes/nodes-library/core-nodes/SpliInBatches/README.md b/docs/nodes/nodes-library/core-nodes/SpliInBatches/README.md index 2292cc51d..91ff820e6 100644 --- a/docs/nodes/nodes-library/core-nodes/SpliInBatches/README.md +++ b/docs/nodes/nodes-library/core-nodes/SpliInBatches/README.md @@ -4,7 +4,7 @@ permalink: /nodes/n8n-nodes-base.splitInBatches # Split In Batches -The Split In Batches node saves the original incoming data, and with each iteration, it returns a predefined amount of data. +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 @@ -14,16 +14,21 @@ The Split In Batches node saves the original incoming data, and with each iterat ## Example Usage -This workflow allows you to read RSS feed from two different sources using the Split In Batches node. You can also find the [workflow](https://n8n.io/workflows/526) on the website. This example usage workflow would use the following two nodes. +This workflow allows you to read RSS feed from two different sources using the Split In Batches node. You can also find the [workflow](https://n8n.io/workflows/687) on the website. This example usage workflow would use the following two nodes. - [Start](../../core-nodes/Start/README.md) - [Function](../../core-nodes/Function/README.md) - [Split In Batches]() - [RSS Feed Read](../../core-nodes/RSSRead/README.md) +The final workflow should look like the following image. + +![A workflow with the Split In Batches node](./workflow.png) + ### 1. Start node The start node exists by default when you create a new workflow. +::: v-pre ### 2. Function node 1. Paste the following JavaScript code snippet in the ***Function*** field. @@ -43,14 +48,31 @@ return [ ]; ``` 2. Click on ***Execute Node*** to run the node. +::: +![Using the Function node to return URLs](./Function_node.png) + +::: v-pre ### 3. SplitInBatches node 1. Set the batch size to `1` in the ***Batch Size*** field. 2. Click on ***Execute Node*** to run the node. +::: +![Using the Split In Batches node to split the data](./SplitInBatches_node.png) + +::: v-pre ### 4. RSS Read node 1. Click on the gears icon next to the ***URL*** field and click on ***Add Expression***. 2. 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"]}}` -3. Click on ***Execute Node*** to run the workflow. \ No newline at end of file +3. Click on ***Execute Node*** to run the workflow. +::: + +![Using the RSS Read node to read data from RSS feed](./RSSFeedRead_node.png) + +## FAQ + +### Can the Split In Batches node receive data multiple times during the execution of the workflow? + +The Split In Batches node uses the data that it receives the first time. It then splits this data into the batches and returns it until nothing is left. diff --git a/docs/nodes/nodes-library/core-nodes/SpliInBatches/RSSFeedRead_node.png b/docs/nodes/nodes-library/core-nodes/SpliInBatches/RSSFeedRead_node.png new file mode 100644 index 000000000..b44c592d0 Binary files /dev/null and b/docs/nodes/nodes-library/core-nodes/SpliInBatches/RSSFeedRead_node.png differ diff --git a/docs/nodes/nodes-library/core-nodes/SpliInBatches/SplitInBatches_node.png b/docs/nodes/nodes-library/core-nodes/SpliInBatches/SplitInBatches_node.png new file mode 100644 index 000000000..7614b4fac Binary files /dev/null and b/docs/nodes/nodes-library/core-nodes/SpliInBatches/SplitInBatches_node.png differ diff --git a/docs/nodes/nodes-library/core-nodes/SpliInBatches/workflow.png b/docs/nodes/nodes-library/core-nodes/SpliInBatches/workflow.png new file mode 100644 index 000000000..f86eac251 Binary files /dev/null and b/docs/nodes/nodes-library/core-nodes/SpliInBatches/workflow.png differ