n8n-binary-and-data

Guide binary and JSON file handling in n8n workflows and AI agent interactions.

421|46|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/n8n-io/skills --skill n8n-binary-and-data
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: n8n-binary-and-data
Source: https://github.com/n8n-io/skills/tree/main/skills/n8n-binary-and-data
Command: npx skills add https://github.com/n8n-io/skills --skill n8n-binary-and-data

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents broken workflows by teaching the correct way to handle binary files alongside JSON in n8n, especially when AI agents and MCP tool boundaries are involved.

Core Features & Use Cases

  • Binary lives in $binary, not $json: avoids the common failure mode of trying to read file contents from JSON.
  • Agent tool boundary workarounds: explains why binary cannot cross the agent/tool boundary and how to stage files in storage and pass keys/URLs through JSON.
  • Reliable binary preservation through JSON transforms: shows how to keep binary using Merge (when nodes strip binary) for outputs like emails with attachments.
  • Chat-hub image requirements: ensures generated images display by uploading to a CDN and returning a URL rather than raw binary.
  • Reference-driven gotchas: consolidates practical patterns for binary basics, merge behavior, and inbound/outbound agent file flows.

Quick Start

Ask your AI agent to process an uploaded PDF by first staging the file, passing the storage key through tool calls, and returning a user-facing URL (not raw binary) for chat display.

Frequently Asked Questions about n8n-binary-and-data

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle file uploads and binary data in n8n workflows?

To handle file uploads and binary data in n8n workflows, you must keep file contents in the $binary property rather than $json. This prevents common workflow failures when processing PDFs, images, and attachments.

Why does binary data not cross n8n AI agent tool boundaries?

Binary data cannot cross n8n AI agent tool boundaries because JSON-only tool calls cannot serialize raw files. You must stage files in external storage and pass the resulting storage keys or CDN URLs through JSON instead.

What's the best way to display generated images in an n8n chat hub?

To display generated images in an n8n chat hub, upload the output to a CDN and return the resulting URL as your JSON output. Returning raw binary directly will not render in the chat interface.

How do I preserve binary attachments when n8n nodes strip them during JSON transforms?

To preserve binary attachments when n8n nodes strip them during JSON transforms, use a Merge node. This rejoins the lost binary data back into the JSON output stream for emails or other attachment-based workflows.

Can I process an uploaded PDF through an n8n AI agent and return it for chat display?

Yes, you can process an uploaded PDF through an n8n AI agent by first staging the file in storage, passing the storage key through tool calls, and returning a user-facing CDN URL for chat display.

What limitations exist when passing file attachments to n8n agent tools?

A key limitation when passing file attachments to n8n agent tools is that binary cannot be directly read from or written to JSON-only tool boundaries. Files must be externally staged with only their keys or URLs passed through.