コードなし:複数のバイナリファイルをBase64に変換
中級
これは自動化ワークフローで、8個のノードを含みます。主にSet, SplitOut, Aggregate, Compression, HttpRequestなどのノードを使用。 カスタムコードなしで複数のバイナリファイルをBase64 JSON配列に変換する
前提条件
- •ターゲットAPIの認証情報が必要な場合あり
カテゴリー
-
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
"id": "BuinUkUBR1JKQBbz",
"meta": {
"instanceId": "8981479cb588889c05b145eaed421551d37a4fff11ab279d3f4744a6577c6002"
},
"name": "No-Code: Convert Multiple Binary Files to Base64",
"tags": [],
"nodes": [
{
"id": "ab159fb7-fa70-43e2-bcf2-fc9928d4e334",
"name": "開始",
"type": "n8n-nodes-base.manualTrigger",
"position": [
0,
272
],
"parameters": {},
"typeVersion": 1
},
{
"id": "bf134357-6efe-45f8-a5c1-577fcd397902",
"name": "デモWebサイトを解凍",
"type": "n8n-nodes-base.compression",
"position": [
448,
272
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "36767516-08c4-43d0-b18d-83e58f833753",
"name": "デモWebサイトをダウンロード",
"type": "n8n-nodes-base.httpRequest",
"position": [
224,
272
],
"parameters": {
"url": "https://github.com/n8n-io/n8n-demo-website/archive/refs/heads/main.zip",
"options": {
"response": {
"response": {
"responseFormat": "file"
}
}
}
},
"typeVersion": 4.2
},
{
"id": "71498fdd-2ea1-4e42-8554-5244be68acbc",
"name": "ファイルを分割",
"type": "n8n-nodes-base.splitOut",
"position": [
672,
272
],
"parameters": {
"options": {},
"fieldToSplitOut": "$binary"
},
"typeVersion": 1
},
{
"id": "011458d6-28a3-4a32-982a-2622eb85023d",
"name": "ファイルをBase64エンコード",
"type": "n8n-nodes-base.extractFromFile",
"position": [
896,
272
],
"parameters": {
"options": {
"keepSource": "binary"
},
"operation": "binaryToPropery",
"binaryPropertyName": "={{ $binary.keys()[0] }}"
},
"typeVersion": 1
},
{
"id": "aa0ccbcc-a237-4107-b41f-413a8eece2b1",
"name": "パスをファイルに追加",
"type": "n8n-nodes-base.set",
"position": [
1120,
272
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "5bf261ef-b89b-40d0-82d4-1dfef62b5c1d",
"name": "path",
"type": "string",
"value": "={{ $binary[$binary.keys()[0]].directory ? $binary[$binary.keys()[0]].directory + '/' : ''}}{{ $binary[$binary.keys()[0]].fileName }}"
},
{
"id": "3a05fbc1-31c6-4491-865b-3a5f59474f23",
"name": "data",
"type": "string",
"value": "={{ $json.data }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "bae79c09-1977-4ed5-ac0f-5e668fbd62bf",
"name": "出力を集約",
"type": "n8n-nodes-base.aggregate",
"position": [
1344,
272
],
"parameters": {
"options": {},
"aggregate": "aggregateAllItemData",
"destinationFieldName": "files"
},
"typeVersion": 1
},
{
"id": "bd118a52-fe0c-4a9f-89fa-44871859e832",
"name": "付箋ノート",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
-352
],
"parameters": {
"width": 1440,
"height": 576,
"content": "## No-Code: Convert Multiple Binary Files to Base64\n\n### Introduction\n\nThis template provides a robust, purely **no-code** solution for a common integration challenge: converting multiple binary files contained within a single n8n item (e.g., after unzipping an archive) into a structured JSON array of Base64 encoded strings.\n\n### Purpose\n\nMany external APIs, especially those handling batch file uploads or complex data structures, require files to be submitted as a single JSON payload. This payload typically needs an array containing two elements for each file: the reconstructed file path/name and the Base64 encoded content. This template automatically handles the file isolation, encoding, path reconstruction, and final JSON aggregation, replacing the need for complex custom JavaScript Code nodes.\n\n### Configuration Steps\n\n1. **Input**: Connect your binary data source (e.g., an **HTTP Request** followed by a **Compression** node) to the first node in this template.\n2. **Split Out**: This node automatically separates the multiple binary files into individual items.\n3. **Extract From File**: This node uses the dynamic expression `{{ $binary.keys()[0] }}` to ensure the correct binary file is targeted and converted to Base64.\n4. **Set**: This node uses a conditional expression to reconstruct the full `path` (including the directory, if present) for each file.\n5. **Aggregate**: The final node merges all individual items into a single, clean JSON item containing a top-level `files` array, ready for your final API call.\n\n\nFor a detailed walkthrough, including the explanation behind the dynamic expressions and why this is superior to the custom code solution, check out the full blog post: [The No-Code Evolution: Base64 Encoding Multiple Files in n8n (Part 2)](https://n8nplaybook.com/post/2025/10/no-code-base64-encoding-in-n8n)."
},
"typeVersion": 1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "3a7d7269-81e0-4c71-a9c4-7f02076dd9fb",
"connections": {
"ab159fb7-fa70-43e2-bcf2-fc9928d4e334": {
"main": [
[
{
"node": "36767516-08c4-43d0-b18d-83e58f833753",
"type": "main",
"index": 0
}
]
]
},
"71498fdd-2ea1-4e42-8554-5244be68acbc": {
"main": [
[
{
"node": "011458d6-28a3-4a32-982a-2622eb85023d",
"type": "main",
"index": 0
}
]
]
},
"aa0ccbcc-a237-4107-b41f-413a8eece2b1": {
"main": [
[
{
"node": "bae79c09-1977-4ed5-ac0f-5e668fbd62bf",
"type": "main",
"index": 0
}
]
]
},
"bf134357-6efe-45f8-a5c1-577fcd397902": {
"main": [
[
{
"node": "71498fdd-2ea1-4e42-8554-5244be68acbc",
"type": "main",
"index": 0
}
]
]
},
"36767516-08c4-43d0-b18d-83e58f833753": {
"main": [
[
{
"node": "bf134357-6efe-45f8-a5c1-577fcd397902",
"type": "main",
"index": 0
}
]
]
},
"011458d6-28a3-4a32-982a-2622eb85023d": {
"main": [
[
{
"node": "aa0ccbcc-a237-4107-b41f-413a8eece2b1",
"type": "main",
"index": 0
}
]
]
}
}
}よくある質問
このワークフローの使い方は?
上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。
このワークフローはどんな場面に適していますか?
中級
有料ですか?
このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。
関連ワークフロー
納税申告アシスタントの構築:Qdrant、Mistral.ai、OpenAIを使用
税務法アシスタントをQdrant、Mistral.ai、OpenAIで構築
Set
Wait
Filter
+
Set
Wait
Filter
38 ノードJimleuk
財務
Page2Image:PDFをPNGワークフロー(マルチページ対応)
PDF.co API を使用して PDF を PNG に変換 (複数ページをサポート)
Set
Html
Limit
+
Set
Html
Limit
25 ノードLudwig
ビルディングブロック
Voyage-Context-3 エンベディングと MongoDB Atlas に基づくドキュメントQ&Aシステム
Voyage-Context-3埋め込みモデルおよびMongoDB Atlasを基盤としたドキュメントQ&Aシステム
Set
Code
Wait
+
Set
Code
Wait
53 ノードJimleuk
エンジニアリング
n8nノードの探索(可視化リファレンスライブラリ内)
n8nノードを可視化リファレンスライブラリで探索
If
Ftp
Set
+
If
Ftp
Set
113 ノードI versus AI
その他
n8nはセルフホストする?以下のいずれかを使ってNotionにアップロードを検討!
複数のファイルをJavaScriptコードでBase64に変換する
Code
Compression
Http Request
+
Code
Compression
Http Request
5 ノードViktor Klepikovskyi
ファイル管理
n8nでGemini AIを使って画像とPDFを5つの方法で処理
n8nでGemini AIを使って画像とPDFを処理する5つの方法
Set
Filter
Split Out
+
Set
Filter
Split Out
28 ノードJulian Kaiser
ビルディングブロック