Skip to main content

Convert JSON objects to base64 strings with file processing

Workflow preview

Workflow preview
100%
Convert JSON objects to base64 strings with file processing preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Encode JSON to Base64 String in n8n This example workflow demonstrates how to convert a JSON object into a base64 encoded string using n8n’s built in file processing capabilities. This is a common ...

Best for

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

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.set, n8n-nodes-base.manualtrigger, n8n-nodes-base.extractfromfile, n8n-nodes-base.converttofile

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Convert JSON objects to base64 strings with file processing
Workflow name
Convert JSON objects to base64 strings with file processing

Encode JSON to Base64 String in n8n

This example workflow demonstrates how to convert a JSON object into a base64-encoded string using n8n’s built-in file processing capabilities. This is a common requirement when working with APIs, webhooks, or SaaS integrations that expect payloads to be base64-encoded.

> Tip: The three green-highlighted nodes (Stringify → Convert to File → Extract from File) can be wrapped in a Subworkflow to create a reusable Base64 encoder in your own projects.


🔧 Requirements

  • Any running n8n instance (local or cloud)
  • No credentials or external services required

What This Workflow Does

  1. Generates example JSON data
  2. Converts the JSON to a string
  3. Saves the string as a binary file
  4. Extracts the file’s contents as a base64 string
  5. Outputs the base64 string on the final node

Step-by-Step Setup

  1. Manual Trigger
    Start the workflow using the Manual Execution node. This is useful for testing and development.

  2. Create JSON Data
    The Create Json Data node uses raw mode to construct a sample object with all major JSON types: strings, numbers, booleans, nulls, arrays, nested objects, etc.

  3. Convert to String
    The Convert to String node uses the expression ={{ JSON.stringify($json) }} to flatten the object into a single string field named json_text.

  4. Convert to File
    The Convert to File node takes the json_text value and saves it to a UTF-8 encoded binary file in the property encoded_text.

  5. Extract from File
    This node takes the binary file and extracts its contents as a base64-encoded string. The result is saved in the base64_text field.


Customization Tips

  • Replace the sample JSON in the Create Json Data node with your own payload structure.
  • To make this reusable, extract the three core nodes into a Subworkflow or wrap them in a custom Function.
  • Use the base64_text output field to post to APIs, store in databases, or include in webhook responses.

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 - Sticky Note

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

Block 2 - Sticky Note1

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

Block 3 - Sticky Note2

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

Block 4 - Sticky Note3

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

Block 5 - Create Json Data

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

Block 6 - Manual Execution

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

Block 7 - Convert JSON to String

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

Block 8 - Extract Base64 from Binary

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

Block 9 - Convert String to Binary

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

3. Summary Table

Workflow Convert JSON objects to base64 strings with file processing
Complexity intermediate
Nodes 9
Categories File Management
Author Wyeth
Published 14 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6008/6008.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 JSON objects to base64 strings with file processing do?

Encode JSON to Base64 String in n8n This example workflow demonstrates how to convert a JSON object into a base64 encoded string using n8n’s built in file processing capabilities. This is a common ...

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.