Binary data#
Binary data is any file-type data, such as image files or documents.
This page collects resources relating to binary data in n8n.
Working with binary data in your workflows#
You can process binary data in n8n workflows. n8n provides nodes to support many tasks. You can also use code to work with binary data.
Nodes#
There are three key nodes dedicated to handling binary data:
- Read Binary Files: load a file from the host machine running n8n.
- Write Binary File: write a file to the host machine running n8n.
- Move Binary Data: transform data between JSON and binary formats.
There are nodes for working with specific file types:
And nodes for performing common tasks:
You can trigger a workflow based on changes to a local file using the Local File trigger.
Code#
You can use the Code node to manipulate binary data in your workflows.
Some examples:
- Get the binary data buffer: get the binary data available in your workflow.
- Split binary data into individual items: if you receive more than one binary file from a node, you can split the binary data into individual items.
Configure binary data mode when self-hosting#
You can configure how your self-hosted n8n instance handles binary data using the Binary data environment variables. This includes tasks such as setting the storage path and choosing how to store binary data.
Your configuration affects how well n8n scales: Scaling | Binary data filesystem mode.
Reading and writing binary files can have security implications. If you want to disable reading and writing binary data, use the NODES_EXCLUDE
environment variable. Refer to Environment variables | Nodes for more information.