Problem returning binary data, Converting XML to XLSX using custom libraries

Describe the issue/error/question

I’am using custom libraries in a code node to convert a XML file to a XLSX using xml2js and xlsx libraries. The issue is when I want to return in the output of the node the binary data seems to have another format like the expected by n8n so I cant download the binary file on my computer.

What is the error message (if any)?

Please share the workflow

Share the output returned by the last node

this is the output returned

and this is the expected output ( this is I want, can download the file)

Information on your n8n setup

  • n8n version: 0.203.0
  • Database you’re using (default: SQLite): MongoDB
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm,, desktop app]: docker

Hey @aartaza,

I would have expected the output to be something like the below, Maybe that is where it is going wrong, So the data item would contain the binary data itself.

item.binary = { 
        output: {
                data: $xlsxBinary,
                mimeType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ,
                fileExtension: 'xlsx',
                fileName: 'output',

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.