Excel icon

Excel

Excel Node

Overview

This node provides basic Excel file manipulation capabilities within an n8n workflow. It allows users to add a new sheet with JSON content, delete an existing sheet by name, or list the sheets present in an Excel file. This is useful for workflows that need to dynamically modify Excel files or extract metadata about their structure.

Common scenarios include:

  • Adding data as a new sheet to an existing Excel workbook.
  • Removing obsolete or unwanted sheets from an Excel file.
  • Retrieving a list of sheet names to decide further processing steps.

For example, you might receive an Excel file via email, add a summary sheet with processed data, and then save or send the updated file.

Properties

Name Meaning
Binary Property Name The name of the binary property containing the Excel file data (default: "data").

Output

The node outputs data in the following way depending on the operation:

  • Add Sheet / Delete Sheet: Outputs the modified Excel file as binary data under the same binary property name specified in input. The binary data includes:

    • data: Base64-encoded Excel file content.
    • fileName: Original filename preserved.
    • mimeType: Original MIME type preserved.
  • List Sheets: Outputs a JSON object with a single field:

    • sheetNames: An array of strings representing the visible (or optionally hidden) sheet names in the Excel file.

Dependencies

  • Requires the Excel file to be provided as binary data in the input item.
  • Uses the xlsx library internally to read and manipulate Excel files.
  • No external API keys or services are required.

Troubleshooting

  • Error: Binary property "X" not found.
    This error occurs if the specified binary property does not exist in the input item. Ensure the binary property name matches exactly the name of the binary data containing the Excel file.

  • Invalid Excel file or corrupted data.
    If the input binary data is not a valid Excel file, the node will fail when trying to parse it. Verify the input file is a proper Excel format.

  • Sheet name not found when deleting.
    If attempting to delete a sheet that does not exist, the node will silently ignore it by filtering out the sheet name. Confirm the sheet name is correct.

Links and References

Discussion