update references to file nodes

This commit is contained in:
Deborah Barnard 2023-12-11 15:11:38 +00:00
parent 8fffa53a28
commit 880c38b169
20 changed files with 24 additions and 92 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 283 KiB

View File

@ -20,7 +20,7 @@ You can access the buffer using n8n's `getBinaryDataBuffer()` function:
/*
* itemIndex: number. The index of the item in the input data.
* binaryPropertyName: string. The name of the binary property.
* The default in the Read Binary Files node is 'data'.
* The default in the Read/Write File From Disk node is 'data'.
*/
let binaryDataBufferItem = await this.helpers.getBinaryDataBuffer(itemIndex, binaryPropertyName);
```

View File

@ -272,10 +272,10 @@ So far, you have mainly worked with text data. But what if you want to process d
In n8n, you can process binary data with the following nodes:
- [Move Binary Data node](/integrations/builtin/core-nodes/n8n-nodes-base.movebinarydata/) to move data between binary and JSON properties.
- [Read Binary Files](/integrations/builtin/core-nodes/n8n-nodes-base.readbinaryfiles/) to read multiple files from the host machine that runs n8n.
- [Write Binary File](/integrations/builtin/core-nodes/n8n-nodes-base.writebinaryfile/) to write a file to the host machine that runs n8n.
- [Spreadsheet File node](/integrations/builtin/core-nodes/n8n-nodes-base.spreadsheetfile/) to read from or write to spreadsheet files of different formats (for example, CSV, XLSX).
- [Read/Write Files from Disk](/integrations/builtin/core-nodes/n8n-nodes-base.filesreadwrite/) to read and write files to/from the machine where n8n is running.
- [Convert to File](/integrations/builtin/core-nodes/n8n-nodes-base.converttofile/) to take input data and output it as a file.
- [Extract From File](/integrations/builtin/core-nodes/n8n-nodes-base.extractfromfile/) to get data from a binary format and convert it to JSON.
To read or write a binary file, you need to write the path (location) of the file in the node's `File Name` parameter.

View File

@ -22,15 +22,13 @@ You can process binary data in n8n workflows. n8n provides nodes to support many
There are three key nodes dedicated to handling binary data:
* [Read Binary Files](/integrations/builtin/core-nodes/n8n-nodes-base.readbinaryfiles/): load a file from the host machine running n8n.
* [Write Binary File](/integrations/builtin/core-nodes/n8n-nodes-base.writebinaryfile/): write a file to the host machine running n8n.
* [Convert to/from binary data](/integrations/builtin/core-nodes/n8n-nodes-base.movebinarydata/): transform data between JSON and binary formats.
- [Read/Write Files from Disk](/integrations/builtin/core-nodes/n8n-nodes-base.filesreadwrite/) to read and write files to/from the machine where n8n is running.
- [Convert to File](/integrations/builtin/core-nodes/n8n-nodes-base.converttofile/) to take input data and output it as a file.
- [Extract From File](/integrations/builtin/core-nodes/n8n-nodes-base.extractfromfile/) to get data from a binary format and convert it to JSON.
There are nodes for working with specific file types:
There are separate nodes for working with XML and HTML data:
* [iCalendar](/integrations/builtin/core-nodes/n8n-nodes-base.ical/)
* [Read PDF](/integrations/builtin/core-nodes/n8n-nodes-base.readpdf/)
* [Spreadsheet File](/integrations/builtin/core-nodes/n8n-nodes-base.spreadsheetfile/)
* [HTML](/integrations/builtin/core-nodes/n8n-nodes-base.html/)
* [XML](/integrations/builtin/core-nodes/n8n-nodes-base.xml/)
And nodes for performing common tasks:

View File

@ -81,7 +81,7 @@ There are many [environment variables configurable in n8n](https://docs.n8n.io/r
| `EXECUTIONS_DATA_PRUNE` | Boolean | `true` | Whether to delete data of past executions on a rolling basis. |
| `EXECUTIONS_DATA_MAX_AGE` | Number | `336` | The execution age (in hours) before it's deleted. |
| `EXECUTIONS_DATA_PRUNE_MAX_COUNT` | Number | `10000` | Maximum number of executions to keep in the database. 0 = no limit |
| `NODES_EXCLUDE` | Array of strings | - | Specify which nodes not to load. For example, to block nodes that can be a security risk if users aren't trustworthy: `NODES_EXCLUDE: "[\"n8n-nodes-base.executeCommand\", \"n8n-nodes-base.readBinaryFile\", \"n8n-nodes-base.readBinaryFiles\", \"n8n-nodes-base.writeBinaryFile\"]"` |
| `NODES_EXCLUDE` | Array of strings | - | Specify which nodes not to load. For example, to block nodes that can be a security risk if users aren't trustworthy: `NODES_EXCLUDE: "[\"n8n-nodes-base.executeCommand\", \"n8n-nodes-base.filesreadwrite\"]"` |
| `NODES_INCLUDE` | Array of strings | - | Specify which nodes to load. |
| `N8N_TEMPLATES_ENABLED` | Boolean | `true` | Enable workflow templates (true) or disable (false). |
| `N8N_TEMPLATES_HOST` | String | `https://api.n8n.io` | Change this if creating your own workflow template library. Note that to use your own workflow templates library, your API must provide the same endpoints and response structure as n8n's. Refer to [Workflow templates](/workflows/templates/) for more information. |

View File

@ -70,7 +70,7 @@ Nodes and operations where you need to design a loop into your workflow:
* [MongoDB](/integrations/builtin/app-nodes/n8n-nodes-base.mongodb/) executes `Find` once, regardless of the number of incoming items.
* [Postgres](/integrations/builtin/app-nodes/n8n-nodes-base.postgres/) node will execute and iterate over all incoming items only for Postgres related functions (for example, `pgInsert`, `pgUpdate`, `pqQuery`).
* [QuestDB](/integrations/builtin/app-nodes/n8n-nodes-base.questdb/) node will execute and iterate over all incoming items only for Postgres related functions (for example, `pgInsert`, `pgUpdate`, `pqQuery`).
* [Read Binary Files](/integrations/builtin/core-nodes/n8n-nodes-base.readbinaryfiles/) node will fetch the files from the specified path only once. This node doesn't execute multiple times based on the incoming data. However, if the path is referenced from the incoming data, the node will fetch the files for all the valid paths.
* [Read/Write File From Disk](/integrations/builtin/core-nodes/n8n-nodes-base.filesreadwrite/) node will fetch the files from the specified path only once. This node doesn't execute multiple times based on the incoming data. However, if the path is referenced from the incoming data, the node will fetch the files for all the valid paths.
* [Redis](/integrations/builtin/app-nodes/n8n-nodes-base.redis/):
* Info: this operation executes only once, regardless of the number of items in the incoming data.
* [RSS](/integrations/builtin/core-nodes/n8n-nodes-base.rssfeedread/) nodes executes only once regardless of the number of items in the incoming data.

View File

@ -224,7 +224,7 @@ Refer to [External storage](/hosting/external-storage/) for more information on
| Variable | Type | Default | Description |
| :------- | :---- | :------- | :---------- |
| `NODES_INCLUDE` | Array of strings | - | Specify which nodes to load. |
| `NODES_EXCLUDE` | Array of strings | - | Specify which nodes not to load. For example, to block nodes that can be a security risk if users aren't trustworthy: `NODES_EXCLUDE: "[\"n8n-nodes-base.executeCommand\", \"n8n-nodes-base.readBinaryFile\", \"n8n-nodes-base.readBinaryFiles\", \"n8n-nodes-base.writeBinaryFile\"]"` |
| `NODES_EXCLUDE` | Array of strings | - | Specify which nodes not to load. For example, to block nodes that can be a security risk if users aren't trustworthy: `NODES_EXCLUDE: "[\"n8n-nodes-base.executeCommand\", \"n8n-nodes-base.filesreadwrite\"]"` |
| `NODE_FUNCTION_ALLOW_BUILTIN` | String | - | Permit users to import specific built-in modules in the Code node. Use * to allow all. n8n disables importing modules by default. |
| `NODE_FUNCTION_ALLOW_EXTERNAL` | String | - | Permit users to import specific external modules (from `n8n/node_modules`) in the Code node. n8n disables importing modules by default. |
| `NODES_ERROR_TRIGGER_TYPE` | String | `n8n-nodes-base.errorTrigger` | Specify which node type to use as Error Trigger. |

View File

@ -35,7 +35,7 @@ For usage examples and templates to help you get started, take a look at n8n's [
* Delete a folder
* Get all folders
**Note:** To attach a file for upload, you will need to use an additional node such as the [Read Binary File](/integrations/builtin/core-nodes/n8n-nodes-base.readbinaryfile/) node or the [HTTP Request](/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/) node to pass the file as a data property.
**Note:** To attach a file for upload, you will need to use an additional node such as the [Read/Write Files from Disk](/integrations/builtin/core-nodes/n8n-nodes-base.filesreadwrite/) node or the [HTTP Request](/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/) node to pass the file as a data property.
## Node reference

View File

@ -17,7 +17,7 @@ Refer to [YouTube credentials](/integrations/builtin/credentials/google/) for gu
For usage examples and templates to help you get started, take a look at n8n's [YouTube integrations](https://n8n.io/integrations/youtube/){:target="_blank" .external-link} list.
///
## Basic Operations
## Operations
* Channel
* Retrieve a channel
@ -45,71 +45,3 @@ For usage examples and templates to help you get started, take a look at n8n's [
* Video Category
* Retrieve all video categories
## Example Usage
This workflow allows you to upload a video, create a playlist, and add the video to the playlist in YouTube. You can also find the [workflow](https://n8n.io/workflows/638) on n8n.io. This example usage workflow would use the following nodes.
- [Start](/integrations/builtin/core-nodes/n8n-nodes-base.start/)
- [Read Binary File](/integrations/builtin/core-nodes/n8n-nodes-base.readbinaryfile/)
- [YouTube]()
The final workflow should look like the following image.
![A workflow with the Gmail node](/_images/integrations/builtin/app-nodes/youtube/workflow.png)
### 1. Start node
The start node exists by default when you create a new workflow.
### 2. Read Binary File node
1. Enter the path to the video file you want to upload in the ***File Path*** field.
2. Click on ***Execute Node*** to run the node.
![Using the Read Binary File node to get the video](/_images/integrations/builtin/app-nodes/youtube/readbinaryfile_node.png)
### 3. YouTube node (upload: video)
1. First of all, you'll have to enter credentials for the YouTube node. You can find out how to do that [here](/integrations/builtin/credentials/google/).
2. Select 'Video' from the ***Resource*** dropdown list.
3. Select 'Upload' from the ***Operation*** dropdown list.
4. Enter the title of the video in the ***Title*** field.
5. Select the region code from ***Region Code*** dropdown list.
6. Select the video category from the ***Category ID*** dropdown list.
7. Click on ***Execute Node*** to run the node.
![Using the YouTube node to upload a video](/_images/integrations/builtin/app-nodes/youtube/youtube_node.png)
### 4. YouTube1 node (create: playlist)
1. Select the credentials that you entered in the previous YouTube node.
2. Select 'Playlist' from the ***Resource*** dropdown list.
3. Select 'Create' from the ***Operation*** dropdown list.
4. Enter the title of the playlist in the ***Title*** field.
5. Click on ***Execute Node*** to run the node.
![Using the YouTube node to create a playlist](/_images/integrations/builtin/app-nodes/youtube/youtube1_node.png)
### 5. YouTube2 node (add: playlistItem)
1. Select the credentials that you entered in the previous YouTube node.
2. Select 'Playlist Item' from the ***Resource*** dropdown list.
3. Select the playlist from the ***Playlist ID*** dropdown list.
4. Click on the gears icon next to the ***Video ID*** field and click on ***Add Expression***.
5. Select the following in the ***Variable Selector*** section: Nodes > YouTube > Output Data > JSON > id. You can also add the following expression: `{{$node["YouTube"].json["id"]}}`.
6. Click on ***Execute Node*** to run the node.
![Using the YouTube node to add the video to the playlist](/_images/integrations/builtin/app-nodes/youtube/youtube2_node.png)

View File

@ -138,7 +138,7 @@ Options:
* Postgres
/// note | SQLite
To use SQLite you will need to use a [Read Binary Files](/integrations/builtin/core-nodes/n8n-nodes-base.readbinaryfiles/) node before the Agent to read your SQLite file.
To use SQLite you will need to use a [Read/Write File From Disk](/integrations/builtin/core-nodes/n8n-nodes-base.filesreadwrite/) node before the Agent to read your SQLite file.
///
### Prompt

View File

@ -10,7 +10,7 @@ Use the Edit Image node to manipulate and edit images.
/// note | Dependencies
1. If you aren't running n8n on Docker, you need to install [GraphicsMagick](http://www.graphicsmagick.org/README.html){:target=_blank .external-link}.
2. You need to use a node such as the [Read Binary File](/integrations/builtin/core-nodes/n8n-nodes-base.readbinaryfile/) node or the [HTTP Request](/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/) node to pass the image file as a data property to the Edit Image node.
2. You need to use a node such as the [Read/Write Files from Disk](/integrations/builtin/core-nodes/n8n-nodes-base.filesreadwrite/) node or the [HTTP Request](/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/) node to pass the image file as a data property to the Edit Image node.
///
/// note | Examples and templates

View File

@ -12,6 +12,10 @@ Use the Read/Write Files from Disk node to read and write files to/from the mach
For usage examples and templates to help you get started, refer to n8n's [Read/Write Files from Disk integrations](https://n8n.io/integrations/read-write-files-from-disk/){:target=_blank .external-link} page.
///
/// note | Self-hosted n8n only
This node isn't available on n8n Cloud.
///
## Node parameters
* **Operation** > **Read File(s) From Disk**:

View File

@ -20,7 +20,7 @@ You can find authentication information for this node [here](/integrations/built
- Rename/move content from old path to new path
- Upload a file
**Note:** To attach a file for upload, you will need to use an additional node such as the [Read Binary File](/integrations/builtin/core-nodes/n8n-nodes-base.readbinaryfile/) node or the [HTTP Request](/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/) node to pass the file as a data property.
**Note:** To attach a file for upload, you will need to use an additional node such as the [Read/Write Files from Disk](/integrations/builtin/core-nodes/n8n-nodes-base.filesreadwrite/) node or the [HTTP Request](/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/) node to pass the file as a data property.
## Node Reference

View File

@ -22,5 +22,5 @@ View [example workflows and related content](https://n8n.io/integrations/send-em
## Attach a file
To attach a file, use the [Read Binary File](/integrations/builtin/core-nodes/n8n-nodes-base.readbinaryfile/) node or the [HTTP Request](/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/) node to upload the file to your workflow.
To attach a file, use the [Read/Write Files from Disk](/integrations/builtin/core-nodes/n8n-nodes-base.filesreadwrite/) node or the [HTTP Request](/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/) node to upload the file to your workflow.

View File

@ -18,7 +18,7 @@ You can find authentication information for this node [here](/integrations/built
- Download a file
- Upload a file
**Note:** To attach a file for upload, you will need to use an additional node such as the [Read Binary File](/integrations/builtin/core-nodes/n8n-nodes-base.readbinaryfile/) node or the [HTTP Request](/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/) node to pass the file as a data property.
**Note:** To attach a file for upload, you will need to use an additional node such as the [Read/Write Files from Disk](/integrations/builtin/core-nodes/n8n-nodes-base.filesreadwrite/) node or the [HTTP Request](/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/) node to pass the file as a data property.
## Node Reference

View File

@ -91,8 +91,6 @@ Never change the incoming data a node receives (data accessible with `this.getIn
It's not necessary to always clone all the data. For example, if a node changes the binary data but not the JSON data, you can create a new item that reuses the reference to the JSON item.
You can see an example in the code of the [ReadBinaryFile-Node](https://github.com/n8n-io/n8n/blob/master/packages/nodes-base/nodes/ReadBinaryFile.node.ts#L69-L83){:target=_blank .external-link}.
### Use the built in request library