Aller au contenu
Agentic Workflowdocs
v0.8.2Installer gratuitement

nœuds / builtin / datatransformation

Compression

Compress or decompress binary data with gzip

Données ExtensionApplication web

Ce contenu n’est pas encore disponible dans votre langue.

Shrink a file into a .gz file, or unpack a .gz file back into its content.

Compression works on the file attached to each item (its binary data), one item at a time:

  • Compress (gzip) reads the attached file in Binary Field and replaces it with a gzip file (application/gzip). If the item has no attached file, it compresses the text in Text to compress instead.
  • Decompress (gunzip) reads a gzip file from Binary Field and replaces it with the unpacked file. With Decode to text on, it puts the unpacked content on the item as plain text instead.

It handles the gzip format (.gz) only. It cannot create or open .zip archives, which hold several files.

To protect your browser, decompression stops with an error if the result grows past 50 MB, or past 200 times the size of the compressed input.

  • Unpack a .gz export (a log, a JSON or CSV dump) you downloaded, so the next node can read it.
  • Compress a large text or file before you upload it or send it to an API that accepts gzip.
  • For .zip archives, use a different tool: this node cannot read them.
RéglageTypeCe que cela fait
Operation ChoiceCompress (gzip) or decompress (gunzip) the input. Options: Compress (gzip), Decompress (gunzip). Par défaut : Compress (gzip)
Binary Field TextThe $binary slot to read the input bytes from and write the result to. Par défaut : data
Text to compress Long textFor gzip only: text to compress when the item has no $binary attachment.
Output file name TextFor gzip: name of the produced file. Left empty, the source name with a ".gz" suffix (or "data.gz") is used.
Output MIME type TextFor gunzip: content type recorded on the decompressed file. Left empty, application/octet-stream is used.
Decode to text ToggleFor gunzip: place the decompressed content as UTF-8 text on the item (in the binary field name) instead of a $binary attachment. Par défaut : Off
  • Leave Binary Field at data unless the previous node stored its file under another name.
  • Text to compress accepts expressions, for example {{ $input.report }}.
  • When decompressing, a name ending in .gz loses that suffix: export.json.gz becomes export.json. Set Output MIME type (for example text/csv) so later nodes know what the file is.
  • Output

Each item keeps its other fields and gets the new file plus fileName, mimeType and size. With Decode to text on, the item instead gets the text in a field named after Binary Field (by default data), so you can read it with {{ $input.data }}.

None. This node needs no connection and has no slots for other nodes.

  1. HTTP Request downloads https://example.com/export.json.gz with Response format set to file.
  2. Compression with Operation set to Decompress (gunzip) and Decode to text on.
  3. JSON parses {{ $input.data }} into fields you can use.
  • “Nothing to compress. Connect an item carrying a $binary attachment, or fill in “Text to compress”.“ The item has no file under Binary Field and the text box is empty. Check the field name, or fill in Text to compress.
  • “No binary to decompress in “$binary.data”.“ Decompressing needs an attached file. Make sure the previous node outputs a file, and that Binary Field matches its name.
  • “Could not decompress the input as gzip. Ensure it is valid gzip data.” The file is not gzip. It may be a plain file or a .zip archive, which this node cannot open.
  • “Decompressed output exceeded the … ceiling; refusing (possible zip bomb).” or “Decompression ratio exceeded 200×”. The unpacked content is too large, or the file is suspiciously over-compressed. Use a smaller file.
Modifier cette page

Dernière mise à jour :

Was this page useful?
Demander à Aria à propos de Compression