N8N

n8n Binary Data

Working with binary data in n8n has always been a bit tricky for many users. Whether you’re handling file uploads, extracting data from documents, or converting between formats, the process used to feel cumbersome and confusing.

Fortunately, n8n recently released a major update  that makes working with binary data easier, more flexible, and much more powerful. You can now access binary data in your workflow and even use it directly within the “Edit Fields” (Edit Set) node .

This article will walk you through everything you need to know about binary data in n8n, including:

  • Understanding what binary data is

  • How to bring binary data into your workflow

  • Extracting and converting files

  • Using AI tools like Mistral and Gemini for extraction and analysis

  • Accessing binary data later in a workflow

  • The latest binary-related updates

  • Working with Base64 data

Let’s dive in.

Before we start, if you are looking for help with a n8n project, we are taking on customers. Head over to our n8n Automation Engineer page.

What Is Binary Data in n8n?

Binary data refers to any file-based data , images, PDFs, spreadsheets, or documents , as opposed to regular JSON text data.

You’ll most often encounter binary data in n8n when:

  • A form uploads a file

  • You pull a file from Google Drive, FTP, or an API

  • You convert a string or object into a downloadable file

Binary data appears under a separate section in the output called “Binary”, while regular text-based data appears as JSON.

Bringing Binary Data Into n8n

There are several ways to import binary data into n8n. The two most common are:

1. Form Submissions

Using the Form Trigger, you can add a field with an Element Type: File.
You can specify:

  • Single or multiple files

  • Allowed file types

  • Whether the field is required

When a file is uploaded and the form is submitted, the output will include the uploaded file under the “Binary” section (e.g., n_monday.jpeg), along with metadata like file type and size. You can even preview or download the file directly within n8n.

 

2. Google Drive or FTP

You can also retrieve files from cloud storage or FTP locations as part of a workflow. Simply configure the node to grab a file and output it as binary data.

Extracting Data from Files

The “Extract from File” node is extremely useful for converting file content into structured JSON data.
A common use case is reading a spreadsheet.

Example:

  • Upload an .xlsx spreadsheet.

  • Use Extract from File with the correct type (XLSX instead of CSV).

  • Make sure the “Input Binary Field” name matches your binary file’s name (e.g., binary file).

  • Execute the step, and you’ll get a table of structured data — rows and columns turned into JSON.

This node is ideal for spreadsheets and CSVs but less relevant for image files.

Extracting Text from Documents and Images (with Mistral)

If you want to extract text from PDFs, scanned documents, or images, Mistral is a great option. It’s particularly useful for OCR (Optical Character Recognition).

How It Works:

  1. Upload or fetch a document (e.g., from Google Drive).

  2. Use the Mistral Extract Text node.

  3. Choose the model and set the input type to Binary Data.

  4. Execute the node.

You’ll get extracted text in Markdown format. You can then clean it up using:

  • Code nodes

  • Large Language Model (LLM) nodes

  • Text-parsing utilities

This is excellent for automated document processing workflows.

Analyzing Images with Gemini

If you need to analyze images , for example, detect logos, objects, or colors , n8n’s integration with Gemini can help.

Example:

  • Upload a thumbnail or image file.

  • Configure the Gemini node:

    • Input: Binary data name (e.g., binary file)

    • Prompt: e.g., “What company logos are present in this image?”

    • Output format: JSON

When executed, Gemini will analyze the image and output a JSON object e.g.:

				
					{
  "companies": ["LinkedIn", "n8n"]
}

				
			

New Updates to Binary Data in n8n

This latest update brought two major improvements:

1. Binary Data in the Edit Fields (Edit Set) Node

You can now assign, rename, or manipulate binary data directly in an Edit Fields node , something that wasn’t possible before.

Example:

  • Original binary file: binary file

  • In Edit Fields, add a Binary Data field

  • Rename it to new image

  • Execute , your binary file is now stored under the new name

This makes renaming and reorganizing files far more intuitive.

2. Accessing Binary Data from Previous Nodes

You can now reference binary data from earlier nodes in your workflow using expressions.

For example:

				
					{{ $('On form submission1').item.binary.binary_file }}
				
			

This means you can:

  • Retrieve and reuse binary files later in the workflow

  • Pass files between multiple steps

  • Edit or process them at any stage

Converting Data to Files

Another common scenario is converting JSON or text data into a downloadable file.

Example Workflow:

  1. Gather data (e.g., JSON from an API).

  2. Use the Convert to File node.

  3. Choose the format (e.g., CSV).

  4. Upload it to Google Drive or send via email.

This is especially useful for automated reporting or data export tasks.

Working with Base64 (B64) Data

Sometimes APIs return images or files in Base64 format.
Base64 is a text-based encoding of binary data , often used for images or file attachments.

To handle this:

  1. Use a Manual Trigger or API node to receive the Base64 string.

  2. Use a B64 node to decode it into binary format.

  3. The output will now be a real image or file (binary data).

You can then view, download, or process it just like any other binary file in n8n.

Wrapping Up

Binary data can seem complex at first, but with the recent n8n updates, it’s now much easier to manage.

Key takeaways:

  • Use Form Triggers, Google Drive, or APIs to bring in files.

  • Use Extract from File for spreadsheets or structured documents.

  • Use Mistral for OCR text extraction from PDFs or images.

  • Use Gemini for AI-powered image analysis.

  • Leverage Edit Fields to rename or assign binary files.

  • Reference binary data in later workflow steps.

  • Convert data to files or decode Base64 for image handling.

With these tools, you can automate virtually any file-related process , from document extraction to image analysis , directly inside n8n.

Final Thoughts

Binary data handling used to be one of the most frustrating parts of n8n. With the recent update, it’s now one of the most powerful features.

Thank you for reading this article. Make sure to check out our other n8n content on the website. If you need any help with n8n workflows we are taking on customers so reach out

Leave a Reply

Your email address will not be published. Required fields are marked *