본문으로 건너뛰기
Skillpedia
일반 코딩48k · #5267

n8n-binary-and-data

하는 일

이 도구는 n8n 안에서 파일과 바이너리 데이터(이미지나 PDF 같은)를 관리하도록 돕습니다. 이 파일들이 올바르게 전송, 수신, 변환, 전달되도록 하며, 일반 데이터(텍스트나 숫자)와 분리해 유지합니다.

사용하는 경우

  • ✓파일을 이메일 첨부로 보내야 할 때.
  • ✓외부 서비스에 파일을 업로드할 때.
  • ✓채팅에 이미지를 표시해야 할 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/n8n-binary-and-data/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/n8n-binary-and-data/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“채팅에서 받은 이미지를 저장 서비스로 어떻게 보내나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 파일 데이터(바이너리)를 텍스트/숫자 데이터와 분리합니다. 파일을 따로 처리하고, AI 에이전트 같은 고급 기능을 쓸 때에도 올바르게 보내거나 받을 수 있도록 합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

n8n Binary and Data

When to Use

Use this skill when an n8n workflow reads, transforms, stores, uploads, downloads, or transmits files and binary fields, including multimodal agent inputs and chat attachments.

Treat uploaded files and generated URLs as potentially sensitive. Obtain approval before sending data to a new external host, use the narrowest retention and access scope available, avoid logging bytes or base64 payloads, and do not embed credentials in URLs or workflow fields.

Every n8n item carries two independent slots: $json for structured data and $binary for file bytes. They travel side by side through the workflow. File contents — the actual PDF, image, or zip — live in $binary, never in $json. Get that split wrong and you read an empty field, lose a file mid-flow, or hand an AI agent a tool input it can't use.

This skill covers where binary lives, how to read and write it, how to keep it from being silently stripped, the hard wall between binary and the AI-agent tool boundary, and why chat surfaces need a URL instead of raw bytes.


The three rules that prevent 90% of binary bugs

  1. File contents are in $binary, not $json. After an HTTP download, a "Read Files", or an email-attachment trigger, the bytes sit in $binary.<key>. $json holds metadata at most. Reading $json.data for file contents gives you nothing.

  2. Binary cannot cross the AI-agent tool boundary — in either direction. Tool arguments and tool return values are JSON only. An uploaded image can't be passed into a tool as a file, and a tool can't return raw bytes. Pre-stage to storage and pass a key or URL through JSON instead. See references/AGENT_TOOL_BINARY.md.

  3. Chat surfaces render images by URL, not by $binary. Slack, Discord, Teams, Telegram, embedded webhook chat — none of them read the binary slot. The image has to live somewhere a URL can fetch it. See references/CDN_REQUIREMENT.md.


The two slots

Each item is shaped like this:

{
  "json": { "customerId": 42, "status": "sent" },
  "binary": {
    "invoice": {
      "data": "<base64-encoded bytes>",
      "mimeType": "application/pdf",
      "fileName": "invoice-42.pdf",
      "fileExtension": "pdf"
    }
  }
}

The key inside binary (invoice here) is the binary property name. Most file-handling nodes have a binaryPropertyName parameter that points at it — the producer names the slot, the consumer references it by that name. The default key across most nodes is data, so when nothing tells you otherwise, assume $binary.data.

$json and $binary are separate namespaces. An expression like {{ $binary.invoice.fileName }} reads file metadata; {{ $json.customerId }} reads data. They never mix.

This split also explains a webhook gotcha: a Webhook trigger receiving multipart/form-data puts the uploaded file in $binary and the accompanying form fields in $json.body — so an uploaded file is not somewhere under $json at all. (The $json.body nesting for webhooks is n8n-expression-syntax territory.)

See references/BINARY_BASICS.md for the full slot anatomy, mime types, and size limits.


Producing binary

You rarely build a $binary slot by hand — nodes populate it for you:

Source How binary appears
HTTP Request with responseFormat: "file" Response body lands in $binary.data (or the name you set)
Read/Write Files from Disk File contents read into $binary
Storage downloads (S3, Google Drive, Dropbox, etc.) Downloaded file in $binary.<key>
Email triggers with attachments Each attachment arrives in $binary
Provider AI media nodes (image/audio gen) Set options.binaryPropertyOutput so the bytes land where the next node looks

For an HTTP download, the one field that matters is responseFormat. Confirm it with get_node on nodes-base.httpRequest — leaving it as the default JSON/string format is the classic reason a downloaded file ends up as garbled text in $json instead of clean bytes in $binary.


Reading and writing binary in a Code node

Most workflows never need to crack open the bytes — they just pass binary through to a consumer (email attachment, file upload, Slack file). When you do need the raw bytes, do it in a Code node.

Read with getBinaryDataBuffer — do not try to base64-decode $binary.<key>.data by hand:

// Code node, "Run Once for Each Item"

…
자주 묻는 질문

파일 데이터는 어디에 저장되나요?

실제 파일 내용(PDF나 이미지 등)은 「$json」이 아니라 「$binary」라는 곳에 있습니다. 「$json」은 일반 데이터를 위한 것입니다.

AI 도구에 파일을 직접 보낼 수 있나요?

아니요. AI 도구는 텍스트(JSON)만 이해합니다. 파일을 먼저 저장한 다음 링크(URL)를 AI에 보내야 합니다.

왜 채팅에 이미지가 나타나지 않나요?

채팅은 이미지를 표시하기 위해 원시 파일 데이터가 아니라 링크(URL)가 필요합니다. 이미지를 저장하고 링크를 제공해야 합니다.

상세 정보

작성자의 원본 설명

Handle n8n files and binary data across uploads, downloads, transforms, multimodal inputs, agent tools, and chat surfaces.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#5267
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬