Overview
The node provides a variety of cryptographic operations including encoding, decoding, encryption, decryption, hashing, HMAC generation, and key derivation. Specifically for the Base64 Encode operation, it converts input data (a UTF-8 string) into its Base64 encoded representation.
This node is useful in scenarios where you need to safely encode binary or textual data into Base64 format for transmission, storage, or embedding in text-based formats such as JSON or XML. For example, encoding an image file's binary content into Base64 so it can be included in an email body or API request.
Properties
| Name | Meaning |
|---|---|
| Input Data | The UTF-8 string data to encode |
Output
The output JSON contains the following fields:
operation: The name of the performed operation, here always"base64Encode".result: The Base64 encoded string result of the input data.success: A boolean indicating if the operation succeeded (true).inputLength: The length of the original input string.
Example output JSON:
{
"operation": "base64Encode",
"result": "SGVsbG8gd29ybGQ=",
"success": true,
"inputLength": 11
}
No binary data output is produced by this operation.
Dependencies
- Uses Node.js built-in
Bufferclass for encoding. - No external services or API keys are required.
- No special n8n credentials or environment variables needed.
Troubleshooting
Common issues:
- Input data must be a valid UTF-8 string. Non-string inputs or invalid encodings may cause errors.
- Very large input strings might impact performance or memory usage.
Error messages:
- If an unknown operation is specified, the node throws an error like
Unknown operation: .... - If the input data is missing or empty, the node may throw an error due to required property validation.
- If an unknown operation is specified, the node throws an error like
Resolution:
- Ensure the "Input Data" property is set and contains valid UTF-8 text.
- Select the correct operation ("Base64 Encode") in the node configuration.