mirror of
https://github.com/n8n-io/n8n-docs.git
synced 2025-11-20 17:48:34 +00:00
⚡ Add example workflow
This commit is contained in:
parent
a7530e2df9
commit
c9faa94b6c
Binary file not shown.
|
After Width: | Height: | Size: 121 KiB |
@ -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.
|
||||
|
||||

|
||||
|
||||
### 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.
|
||||
:::
|
||||
|
||||

|
||||
|
||||
::: 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.
|
||||
:::
|
||||
|
||||

|
||||
|
||||
::: 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.
|
||||
3. Click on ***Execute Node*** to run the workflow.
|
||||
:::
|
||||
|
||||

|
||||
|
||||
## 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.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 275 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 103 KiB |
BIN
docs/nodes/nodes-library/core-nodes/SpliInBatches/workflow.png
Normal file
BIN
docs/nodes/nodes-library/core-nodes/SpliInBatches/workflow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 151 KiB |
Loading…
Reference in New Issue
Block a user