The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "No-Code: Convert Multiple Binary Files to Base64",
"nodes": [
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
0,
272
],
"id": "ab159fb7-fa70-43e2-bcf2-fc9928d4e334",
"name": "Start"
},
{
"parameters": {},
"type": "n8n-nodes-base.compression",
"typeVersion": 1.1,
"position": [
448,
272
],
"id": "bf134357-6efe-45f8-a5c1-577fcd397902",
"name": "Unzip Demo Website"
},
{
"parameters": {
"url": "https://github.com/n8n-io/n8n-demo-website/archive/refs/heads/main.zip",
"options": {
"response": {
"response": {
"responseFormat": "file"
}
}
}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
224,
272
],
"id": "36767516-08c4-43d0-b18d-83e58f833753",
"name": "Download Demo Website"
},
{
"parameters": {
"fieldToSplitOut": "$binary",
"options": {}
},
"type": "n8n-nodes-base.splitOut",
"typeVersion": 1,
"position": [
672,
272
],
"id": "71498fdd-2ea1-4e42-8554-5244be68acbc",
"name": "Split Out Files"
},
{
"parameters": {
"operation": "binaryToPropery",
"binaryPropertyName": "={{ $binary.keys()[0] }}",
"options": {
"keepSource": "binary"
}
},
"type": "n8n-nodes-base.extractFromFile",
"typeVersion": 1,
"position": [
896,
272
],
"id": "011458d6-28a3-4a32-982a-2622eb85023d",
"name": "Encode Files to Base64"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "5bf261ef-b89b-40d0-82d4-1dfef62b5c1d",
"name": "path",
"value": "={{ $binary[$binary.keys()[0]].directory ? $binary[$binary.keys()[0]].directory + '/' : ''}}{{ $binary[$binary.keys()[0]].fileName }}",
"type": "string"
},
{
"id": "3a05fbc1-31c6-4491-865b-3a5f59474f23",
"name": "data",
"value": "={{ $json.data }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
1120,
272
],
"id": "aa0ccbcc-a237-4107-b41f-413a8eece2b1",
"name": "Add Path to Files"
},
{
"parameters": {
"aggregate": "aggregateAllItemData",
"destinationFieldName": "files",
"options": {}
},
"type": "n8n-nodes-base.aggregate",
"typeVersion": 1,
"position": [
1344,
272
],
"id": "bae79c09-1977-4ed5-ac0f-5e668fbd62bf",
"name": "Aggregate Output"
},
{
"parameters": {
"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).",
"height": 576,
"width": 1440
},
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
-352
],
"typeVersion": 1,
"id": "bd118a52-fe0c-4a9f-89fa-44871859e832",
"name": "Sticky Note"
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "Download Demo Website",
"type": "main",
"index": 0
}
]
]
},
"Unzip Demo Website": {
"main": [
[
{
"node": "Split Out Files",
"type": "main",
"index": 0
}
]
]
},
"Download Demo Website": {
"main": [
[
{
"node": "Unzip Demo Website",
"type": "main",
"index": 0
}
]
]
},
"Split Out Files": {
"main": [
[
{
"node": "Encode Files to Base64",
"type": "main",
"index": 0
}
]
]
},
"Encode Files to Base64": {
"main": [
[
{
"node": "Add Path to Files",
"type": "main",
"index": 0
}
]
]
},
"Add Path to Files": {
"main": [
[
{
"node": "Aggregate Output",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "3a7d7269-81e0-4c71-a9c4-7f02076dd9fb",
"id": "BuinUkUBR1JKQBbz",
"tags": []
}
About this workflow
No-Code: Convert Multiple Binary Files to Base64. Uses manualTrigger, compression, httpRequest, splitOut. Event-driven trigger; 8 nodes.
Source: https://github.com/vklepikovskiy/n8nplaybook-public/blob/main/workflows/no_code_base64.json — original creator credit. Request a take-down →