Convertor icon

Convertor

Convert data from one format to another

Binary → Convert To Binary

AI-generated

Overview

This node, named "Convertor," provides functionality to convert data between different formats, specifically focusing on binary data transformations. The "Convert To Binary" operation converts input data—either a file or text—into binary format. This is useful when you need to prepare textual or file data for workflows that require binary inputs, such as uploading files, sending attachments, or processing data in binary form.

Common scenarios:

  • Converting plain text into a binary file to be sent as an attachment.
  • Transforming an existing binary file property from previous nodes into a standardized binary output.
  • Preparing data for integrations that only accept binary payloads.

Practical example:
You have a string of JSON data and want to convert it into a binary file with a .json extension and appropriate MIME type before uploading it to a cloud storage service. Using this node, you select "Text" as the input type, provide the JSON string, specify the filename (e.g., data.json), and set the MIME type to application/json. The node outputs the binary data ready for upload.

Properties

Name Meaning
Input Type Selects the type of input data to convert: either "File" (binary file input) or "Text" (string input).
Text Input The text content to convert into binary format. Only shown if Input Type is "Text".
Input Binary Field The name of the binary property containing the file data to convert. Only shown if Input Type is "File".
Options Additional options for the output binary data:
  File Name The desired filename for the output binary file (e.g., data.txt).
  Mime Type The MIME type of the output binary file (e.g., application/zip).

Output

The node outputs an array of items where each item contains a binary property holding the converted binary data. The binary data includes:

  • The file contents as binary.
  • Metadata such as the filename and MIME type if provided.

This binary output can then be used by subsequent nodes that accept binary data, such as file uploaders or processors.

Dependencies

  • No external services or API keys are required.
  • The node relies on n8n's internal binary data handling capabilities.
  • No additional environment variables or configurations are necessary.

Troubleshooting

  • Issue: No binary data appears in the output.

    • Cause: The specified input binary field does not exist or is empty.
    • Resolution: Verify the input binary property name matches exactly the property in the incoming data.
  • Issue: Output file has incorrect or missing filename or MIME type.

    • Cause: Filename or MIME type options were left blank.
    • Resolution: Provide explicit values for filename and MIME type in the options to ensure correct metadata.
  • Issue: Text input is empty but conversion still runs.

    • Cause: No text was provided in the "Text Input" property.
    • Resolution: Ensure the "Text Input" field contains valid text when using the "Text" input type.

Links and References

Discussion