N8N Tools - File Converter icon

N8N Tools - File Converter

Convert between various file formats using N8N Tools platform

Overview

The node "N8N Tools - File Converter" provides file format conversion and optimization capabilities using the N8N Tools platform. It supports three main operations:

  • Convert Format: Convert a single file from one format to another (e.g., PDF to DOCX, JPG to PNG).
  • Batch Convert: Convert multiple files at once to a specified target format.
  • Optimize File: Reduce file size while maintaining quality by applying compression and optionally removing metadata.

This node is useful in workflows where automated file processing is needed, such as preparing documents for distribution, resizing images for web use, or compressing media files to save storage and bandwidth.

Practical Examples

  • Automatically convert uploaded images from various formats to optimized JPEGs for faster website loading.
  • Batch convert a set of documents from DOCX to PDF before sending them out.
  • Optimize large video files by compressing them with a chosen quality level to reduce file size.

Properties

Name Meaning
Input Source Specifies the source of the input file(s). Options: Binary File, URL, Base64 string.
Binary Property Name of the binary property containing the file when input source is Binary File.
File URL Publicly accessible URL of the file when input source is URL.
File (Base64) Base64 encoded content of the file when input source is Base64 string.
Quality Settings Quality setting for output file. Options: High, Medium, Low.
Compression Level Compression level for optimization operation. Options: High (smaller file), Medium, Low (higher quality).
Advanced Options Collection of additional options:
- Password: Password for password-protected files.
- Overwrite: Whether to overwrite existing files (boolean).
- Remove Metadata: Remove metadata from files during optimization (boolean, only for optimizeFile operation).

Output

The node outputs JSON data combined with binary data representing the converted or optimized file(s):

  • For Convert Format and Optimize File operations:

    • The output contains a json object with operation details and success status.
    • A binary property named data holds the processed file's binary content.
    • The binary data includes filename and MIME type metadata.
  • For Batch Convert operation:

    • The output contains a ZIP archive in the binary.data property that bundles all converted files.
    • The JSON part includes operation metadata and success status.

If no binary data is returned from the API, the node outputs a warning message in the JSON.

Dependencies

  • Requires an API key credential for the N8N Tools platform.
  • The node makes HTTP POST requests to the N8N Tools API endpoints for file conversion and optimization.
  • The API base URL and API key must be configured in the node credentials.
  • No other external dependencies are required.

Troubleshooting

  • No binary data found under property: This error occurs if the specified binary property does not exist in the input item. Ensure the correct binary property name is provided.
  • Unknown operation: Happens if an unsupported operation value is selected. Use only the supported operations: convertFormat, batchConvert, optimizeFile.
  • Unknown input source: Occurs if an invalid input source is selected. Use only binary, url, or base64 as input sources.
  • File conversion failed: Generic error indicating the API request failed. Check API key validity, network connectivity, and input file correctness.
  • No binary data returned from API: The API did not return any file data. Verify the input file and parameters.

To resolve errors, verify all required properties are correctly set, ensure valid API credentials, and confirm the input files exist and are accessible.

Links and References

Discussion