Decompressing gzip from Amazon SP API Reports

Describe the problem/error/question

Hi, i’m trying to receive order reports from the amazon Selling Partner API but those are Gzip compressed and i can’t get the decompression node to work. Does anyone have experience with Amazon order reports and how to decompress them?
The general workflow around posting report requests, getting their status and downloading them works.
The problem only occurs when a gzip compressionAlgorithm is used.

What is the error message (if any)?

There is no real error. The output is just crypted.

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

I can’t realy share the nodes as those contain sensitive data.

Share the output returned by the last node

Sorry, also sensitive data.

Information on your n8n setup

  • n8n version: 1.66.0
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud
  • Operating system: Windows 11 Pro 24H2

Best regards,
Stefan

Hi,

What is the exact filename of those files?

I have found a github issues that mentions issues when there is no file extension

reg,
J.

1 Like

Hi,
the file extension is there but its wrong. (Screenshot attached)
I already tried to force switch it to .gz with mime-type gzip/application with an additional edit fields node but that didn’t help either.

best regards,
Stefan

Hi again,
thanks for the link!
i added a slightly edited code node and now it seems to work:
const output = ;
for (const item of $input.all()) {
item.binary.data.fileExtension = ‘gz’;
output.push(item);
}
return output;

Best regards,
Stefan

1 Like

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