Excel icon

Excel

Excel Node

Overview

This node provides operations to manipulate Excel files within an n8n workflow. It supports adding new sheets with specified content, deleting existing sheets by name, and listing sheet names in an Excel file. This is useful for automating Excel file modifications such as dynamically updating reports, managing data organization across sheets, or extracting sheet metadata.

Practical examples:

  • Adding a new sheet with JSON data converted into tabular format.
  • Removing obsolete or sensitive sheets from an Excel workbook before sharing.
  • Retrieving all visible sheet names to drive conditional logic in workflows.

Properties

Name Meaning
Operation The action to perform on the Excel file: Add Sheet, Delete Sheet, or List Sheets.
Binary Property Name The name of the binary input property containing the Excel file data (default: "data").
Sheet Name The name of the sheet to add or delete. Required for Add Sheet and Delete Sheet operations.
Sheet Contents JSON array representing the contents of the new sheet to add. Required for Add Sheet operation.
Include Hidden Sheets Boolean flag to include hidden sheets when listing sheet names. Only relevant for List Sheets operation.

Output

  • For Add Sheet and Delete Sheet operations, the output contains the modified Excel file as binary data under the same binary property name. The binary data includes:

    • data: Base64 encoded Excel file buffer.
    • mimeType: Original MIME type of the file.
    • fileName: Original file name.
  • For List Sheets operation, the output JSON contains:

    • sheetNames: An array of sheet names (strings). If "Include Hidden Sheets" is false, hidden sheets are excluded.

Dependencies

  • Requires the xlsx library for reading, modifying, and writing Excel files.
  • Input Excel file must be provided as binary data in the specified binary property.
  • No external API keys or services are required.

Troubleshooting

  • Error: Binary property "X" not found.

    • Occurs if the specified binary property does not exist in the input item.
    • Solution: Ensure the binary property name matches the actual input binary field containing the Excel file.
  • Invalid or corrupted Excel file input

    • The node expects valid Excel file data in base64 encoding.
    • Solution: Verify that the input binary data is a proper Excel file.
  • Sheet name conflicts

    • Adding a sheet with a name that already exists will append another sheet with the same name (Excel allows duplicate sheet names but it may cause confusion).
    • Deleting a non-existent sheet will silently proceed without error.

Links and References

Discussion