No-Code File Encoder: Base64 Conversion for Zipped Assets - n8n Workflow

Master Base64 encoding for multiple binary files in n8n without custom code. This robust n8n workflow downloads, unzips, and aggregates files into a structured JSON array suitable for API submission.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Automation specialists needing to submit multiple files to external APIs that require Base64 encoded payloads.

  • Users looking for advanced, purely no-code data transformation solutions within n8n.

  • Developers migrating legacy code-based file processing to efficient n8n templates.

  • Anyone seeking a powerful example of the n8n node structure for splitting, processing, and aggregating data.

Overview

This sophisticated n8n workflow solves the common challenge of handling multiple binary files simultaneously and preparing them for external APIs. Many modern APIs require files to be submitted not via traditional multipart form data, but as a single JSON payload where the file content is Base64 encoded. This n8n node sequence is designed to be purely no-code, eliminating the complexity and maintenance associated with custom JavaScript solutions. By leveraging powerful core n8n nodes like Split Out and Extract From File, this n8n automation reliably downloads an archive, extracts its contents, encodes every file to Base64, reconstructs the original file path, and aggregates everything into a structured output array. This robust approach is a critical building block for advanced file-handling n8n workflow implementations.

How it Works

The n8n trigger for this automation is a manual start, perfect for initial testing or integration into a larger schedule-driven n8n workflow.


  1. Download & Decompress: The n8n workflow starts by using an HTTP Request n8n node to download a specified zip archive (a demo website zip in this case), saving it as a binary file. A Compression n8n node immediately unzips the file, resulting in one n8n item containing multiple binary file representations.

  2. Isolate Files: The critical Split Out Files n8n node separates this single item into multiple individual items, one for each file inside the zip. This ensures that subsequent operations process files sequentially.

  3. Encode Data: The Encode Files to Base64 n8n node (an Extract From File node) performs the conversion, turning the binary data of the current item into a Base64 string property named data.

  4. Structure Payload: A Set n8n node dynamically reconstructs the original full file path and name, using metadata exposed by the binary processing n8n node steps, and assigns the newly generated Base64 string.

  5. Final Array Generation: Finally, the Aggregate Output n8n node collects all separated n8n items and merges them into a single item. The output is a clean JSON structure containing a top-level files array, ready for submission to downstream n8n nodes or external API endpoints. This method provides a reliable n8n template for complex data handling.

Installation Guide


  1. Import the n8n workflow: Copy the provided n8n workflow JSON structure. Navigate to your n8n instance, go to the Workflows section, click "+ New", and select "Import from JSON".

  2. Review Credentials: This specific n8n template uses standard internal processing n8n nodes (HTTP Request, Set, Aggregate) and requires no external credentials to function.

  3. Customize Source (Optional): If you are adapting this n8n workflow for your own data source, modify the URL in the Download Demo Website HTTP Request n8n node to target your desired zipped file. Crucially, ensure the response format in this n8n node is set to File.

  4. Execute: Click the Start n8n trigger and run the n8n workflow to verify the extraction and Base64 encoding results.

Node Details

Start (n8n trigger): Serves as the manual activation point for this n8n workflow.
Download Demo Website (HTTP Request n8n node): Downloads a remote zip file containing assets.
Key Configuration: Response format is strictly set to file to ensure binary compatibility with the next n8n node.
Unzip Demo Website (Compression n8n node): Decompresses the downloaded binary file.
Function: Transforms the single zip binary into multiple file binaries within one n8n item.
Split Out Files (Split Out n8n node): Separates the combined binary data structure into multiple, individual n8n items, enabling item-by-item processing.
Key Configuration: Splits out the $binary field.
Encode Files to Base64 (Extract From File n8n node): Converts the binary content into a Base64 string, effectively doing the encoding without custom code.
Key Configuration: Operation is Binary to Property. The property name is dynamically targeted using {{ $binary.keys()[0] }} to maintain compatibility regardless of the internal binary key name.
Add Path to Files (Set n8n node): Restructures the data to include the necessary path and data fields.
Key Configuration: Uses expressions to reconstruct the full path (including directory, if present) and extracts the Base64 data string.
Aggregate Output (Aggregate n8n node): Merges all individually processed items back into a single output item.
Key Configuration*: Aggregates all data into a destination field named files, creating the final JSON array.

Related n8n Workflows

Free

Nodes: 8 Nodes
Updated: December 26 2025
View all

Featured*