Skip to main content

Convert multiple binary files to base64 JSON arrays with no custom code

Workflow preview

Workflow preview
100%
Convert multiple binary files to base64 JSON arrays with no custom code preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

No Code: Convert Multiple Binary Files to Base64 Introduction This template provides a robust, purely no code solution for a common integration challenge: converting multiple binary files contained...

Best for

  • File Management automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.compression, n8n-nodes-base.httprequest, n8n-nodes-base.splitout, n8n-nodes-base.extractfromfile, n8n-nodes-base.set, n8n-nodes-base.aggregate, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Viktor Klepikovskyi.

Original n8n.io source

1.1 Workflow description

Title
Convert multiple binary files to base64 JSON arrays with no custom code
Workflow name
Convert multiple binary files to base64 JSON arrays with no custom code

No-Code: Convert Multiple Binary Files to Base64

Introduction

This 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.

Purpose

Many 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.

Configuration Steps

  1. Input: Connect your binary data source (e.g., an HTTP Request followed by a Compression node) to the first node in this template.
  2. Split Out: This node automatically separates the multiple binary files into individual items.
  3. Extract From File: This node uses the dynamic expression {{ $binary.keys()[0] }} to ensure the correct binary file is targeted and converted to Base64.
  4. Set: This node uses a conditional expression to reconstruct the full path (including the directory, if present) for each file.
  5. 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.

For 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).

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Start

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - Unzip Demo Website

Type / Role
n8n-nodes-base.compression - compression
Config choices
Version 1.1

Block 3 - Download Demo Website

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 4 - Split Out Files

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 5 - Encode Files to Base64

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1

Block 6 - Add Path to Files

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - Aggregate Output

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 8 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Convert multiple binary files to base64 JSON arrays with no custom code
Complexity intermediate
Nodes 8
Categories File Management
Author Viktor Klepikovskyi
Published 11 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9481/9481.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Convert multiple binary files to base64 JSON arrays with no custom code do?

No Code: Convert Multiple Binary Files to Base64 Introduction This template provides a robust, purely no code solution for a common integration challenge: converting multiple binary files contained...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your File Management use case.