Skip to content

XLS Writer

The XLS Writer component lets you take data from your workflow and save it as an Excel (.xls) file. You give it a file name and the content you want inside the file, and it returns a Data object that contains the file’s path and its base64‑encoded contents. This is handy when you need to export results to Excel for reporting or further analysis.

How it Works

When you run the component, it first checks what type of data you supplied for File Content. It can be a list, a single Data object, or a Message. The component then creates a new Excel workbook in memory, adds a sheet called “Sheet1”, and writes each row of data into the sheet. After the workbook is ready, it writes the file to a temporary folder, reads the file back, encodes it in base64, and packages everything into a Data object. The output Data object contains the file name, the base64 text, and some metadata such as MIME type.

Inputs

  • File Content: The data you want to put into the Excel file. It can be a list of rows, a single Data object, or a Message. This field is required.
  • File Name: The name you want to give the file (without the extension). This field is required.

Outputs

  • File: A Data object that holds the generated Excel file. The object includes:
    • file_name: the name of the file (e.g., file.xlsx).
    • text: the file’s contents encoded in base64, ready for download or further processing.
    • metadata: information such as MIME type and encoding.

You can use this output to send the file to another component, store it, or provide it to a user.

Usage Example

  1. Drag the XLS Writer component onto your canvas.
  2. Connect a component that produces data (e.g., a database query or a CSV reader) to the File Content input.
  3. Type a name like Report into the File Name field.
  4. Run the workflow.
  5. The component will output a Data object that you can pass to a File Download component or store in a cloud bucket.
  • CSV Writer – Create CSV files from data.
  • PDF Writer – Generate PDF documents.
  • File Downloader – Send a file to a user’s browser.

Tips and Best Practices

  • Keep the data you send to File Content small enough to fit comfortably in memory; large datasets may slow down the component.
  • Use the File Name field to include a meaningful name; the component automatically adds the .xlsx extension.
  • If you need the file in a different format, consider using the CSV Writer or PDF Writer components instead.

Security Considerations

The component writes files only to a temporary directory that is cleaned up after the workflow finishes, so no files are left on the server. However, the base64 data is returned in the output, so be careful not to expose sensitive information in public workflows. If the data contains confidential information, restrict access to the workflow or encrypt the output before sharing.