| .. | ||
| HTTPRequest_node.png | ||
| MoveBinaryData_node.png | ||
| README.md | ||
| workflow.png | ||
| WriteBinaryFile_node.png | ||
| permalink | description |
|---|---|
| /nodes/n8n-nodes-base.moveBinaryData | Learn how to use the Move Binary Data node in n8n |
Move Binary Data
The Move Binary Data node is useful to move data between binary and JSON properties.
Node Reference
-
Mode: This field specifies from where and to the data should be moved.
- Binary to JSON
- JSON to Binary
-
Set all Data: If set to active, all JSON data is replaced with the data retrieved from binary key. If it is not set to active, the data will be written to a single key. This field is displayed when 'Binary to JSON' is selected from the Mode dropdown list.
-
Source Key: The name of the binary key to get data from. It is also possible to define deep keys by using dot-notation. For example, "level1.level2.currentKey". This field is displayed when 'Binary to JSON' is selected from the Mode dropdown list.
-
Destination Key: The name the JSON key to copy data to. It is also possible to define deep keys by using dot-notation. For example, "level1.level2.newKey". This field is displayed when 'Binary to JSON' is selected from the Mode dropdown list.
-
Convert all Data: If set to active all JSON data will be converted to binary. If it is not set to active only the data with one key will be converted. This field is displayed when 'JSON to Binary' is selected from the Mode dropdown list.
-
Destination Key: The name of the binary key to copy data to. It is also possible to define deep keys by using dot-notation. For example, "level1.level2.newKey". This field is displayed when 'JSON to Binary' is selected from the Mode dropdown list.
-
Options
- Keep Source: Keep the source key. By default it gets deleted.
- The following are the options when 'Binary to JSON' is selected from the Mode dropdown list.
- Encoding: Set the encoding of the datastream.
- JSON Parse: Run JSON parse on the data to get proper object data. This field is displayed when Set all Data is set to 'false'.
- Keep As Base64: Keeps the binary data as base64 string. This field is displayed when Set all Data is set to 'false'.
- The following are the options when 'JSON to Binary' is selected from the Mode dropdown list.
- File Name: The file name to set.
- Mime Type: The mime-type to set. By default the JSON mime-type will be set.
- Use Raw Data: Use data as is and do not stringify it.
- Data is Base64: Keeps the binary data as base64 string. This field is displayed when Convert all Data is set to 'false'.
Example Usage
This workflow allows you to store the JSON data received from the CocktailDB API to your machine. You can also find the workflow on n8n.io. This example usage workflow uses 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.
2. HTTP Request node (GET)
- Enter
https://www.thecocktaildb.com/api/json/v1/1/random.phpin the URL field. - Click on Execute Node to run the node.
3. Move Binary Data node (JSON to Binary)
- Select 'JSON to Binary' from the Mode dropdown list.
- Click on Execute Node to run the node.
4. Write Binary File node
- Enter the file name in the File Name field.
- Click on Execute Node to run the node.



