N8N Tools - File Converter icon

N8N Tools - File Converter

Convert between various file formats using N8N Tools platform

Overview

The "N8N Tools - File Converter" node enables users to convert files between a wide variety of formats, optimize file sizes, and perform batch conversions. It supports multiple input sources including binary data from previous nodes, publicly accessible URLs, and Base64 encoded strings. This flexibility makes it useful in workflows where files need to be transformed or optimized before further processing or storage.

Common scenarios include:

  • Converting document formats (e.g., DOCX to PDF).
  • Changing image formats (e.g., PNG to JPG).
  • Audio and video format conversions.
  • Optimizing files to reduce size while maintaining quality.
  • Batch converting multiple files at once.

Practical example: A user receives uploaded images in various formats and wants to standardize them all to JPG with medium quality for consistent display on a website. They can use this node to convert and optimize the images automatically.

Properties

Name Meaning
Operation The action to perform: Convert Format, Batch Convert, or Optimize File.
Input Source Source of the input file(s): Binary File, URL, or Base64 string (varies by operation).
Binary Property (For single file operations) Name of the binary property containing the file to convert/optimize.
Binary Properties (For batch convert) Comma-separated names of binary properties containing files to convert.
File URL (For single file via URL) Publicly accessible URL of the file to convert/optimize.
File URLs (For batch convert via URLs) Multiple file URLs, one per line.
File (Base64) (For single file via Base64) Base64 encoded content of the file to convert.
Target Format Desired output format for conversion (e.g., pdf, docx, jpg, mp3, mp4, xlsx, csv, etc.).
Quality Settings Output quality level: High, Medium, or Low.
Compression Level (For optimization) Compression level: High (smaller file), Medium, or Low (higher quality).
Advanced Options Additional settings including:
- Password: For password-protected files.
- Overwrite: Whether to overwrite existing files.
- Remove Metadata: (Optimization only) Remove metadata from files during optimization.

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:

    • json: Metadata about the operation result, including success status, timestamp, and any warnings.
    • binary.data: The converted or optimized file as binary data, ready for downstream nodes.
  • For Batch Convert, the output is a ZIP archive containing all converted files:

    • json: Metadata similar to above.
    • binary.data: ZIP file binary data containing all batch-converted files.

If no binary data is returned from the API, a warning is included in the JSON output.

Dependencies

  • Requires an external API service ("N8N Tools platform") accessed via HTTP POST requests.
  • Needs an API key credential configured in n8n for authentication.
  • The node sends requests to the API endpoint specified in the credentials.
  • The workflow must have internet access to reach the API and any URLs used as input.

Troubleshooting

  • No binary data found under property: Occurs if the specified binary property does not exist in the input item. Ensure the correct binary property name is provided.
  • Unknown operation or input source: Happens if an unsupported operation or input source is selected. Verify the chosen options are valid.
  • File conversion failed: Generic error indicating the API call failed. Check API key validity, network connectivity, and input file correctness.
  • No binary data returned from API: The API did not return a file. This might indicate an issue with the input file or unsupported conversion.
  • For password-protected files, ensure the correct password is provided in advanced options.
  • When using URLs, confirm that the URLs are publicly accessible without authentication.

Links and References

  • No direct links available from the code. Users should refer to the documentation of the external N8N Tools platform API for detailed information on supported formats and options.

Discussion