
Module 9 Lesson 2: Debugging Binary Data
See the unseeable. Learn how to inspect files, images, and PDFs inside your workflows, and how to troubleshoot 'Broken File' errors when moving data between nodes.
Module 9 Lesson 2: Debugging Binary Data
JSON is text; you can read it. Binary data (Images, PDFs, ZIPs) is invisible. When a "PDF Upload" fails, you need specialized tools to find the bug.
1. The Binary Tab
In any node that handles files, look for the "Binary" icon next to the JSON icon.
- It shows the File Name, Mime-type (e.g.,
image/png), and Size. - Check: If the size is 0 bytes, your download failed earlier in the workflow!
2. Setting the "Binary Property"
A common mistake is using the wrong "Key."
- Node A downloads as
data. - Node B expects
attachment. - The Fix: Use the "Rename Binary" node or ensure all nodes in your chain are using the exact same name for the binary field.
Visualizing the Process
graph TD
Start[Input] --> Process[Processing]
Process --> Decision{Check}
Decision -->|Success| End[Complete]
Decision -->|Retry| Process
3. The "HTTP Request" File Trap
When downloading a file via HTTP, you MUST set the "Response Format" to "File".
- If you leave it as "Default/JSON," n8n will try to read a PNG as text, and you will get a "Garbage Character" error.
4. Viewing the File
n8n allows you to "Click" the binary preview to download it to your laptop.
- Tip: If you are generating a dynamic image (like an invoice), download it at every step of the workflow to make sure the text is actually appearing where it should.
Exercise: The Binary Detective
- Use the HTTP Request node to download the n8n logo from
https://n8n.io/logo.png. - Ensure "Response Format" is set to "File."
- Open the node and find the Binary tab. Is the Mime-type correct?
- Try to rename the binary property from
datatoproduct_photo. - Why does "Binary Data" use more RAM than "JSON Data"? (How does this affect Module 2's scaling?)
- Research: What is the "Convert to Binary" node used for?
Summary
Files are the "Heavy lifting" of automation. By learning how to inspect, rename, and correctly download binary data, you remove the guesswork from your media-heavy workflows and ensure perfect file delivery every time.
Next Lesson: Safety in history: Version Control: Backing up to Git.