Skip to main content

Zip / Unzip

Packs several files into one zip — to attach to an e-mail or upload in one go — or unpacks a zip you received so each file can go to its own step.

Parameters​

NameShown forDefaultDescription
Operation (operation)allZip fileszip or unzip.
Files (files)zip—One file or a list of files from earlier steps: e-mail attachments ({{ $trigger.attachments }}), File or Convert to File results, or {{ $nodes['Unzip'].files }}. Up to 1,000 files and 1 GB in total.
Zip file name (fileName)ziparchive.zipThe name of the new file; .zip is added when missing. Expressions work, e.g. invoices-{{ $today }}.zip.
Compression (compression)zipSmallest fileoptimal, fastest, or none (store only — quickest for photos, videos and PDFs, which barely shrink).
Zip file (file)unzip—The zip to unpack.
Only files matching (pattern)unzipall filesUnpack only matching files. * matches any text, ? one character; separate patterns with commas: *.csv, reports/*.pdf. A pattern without a folder matches the file name in any folder.
Largest total size (MB) (maxSizeMb)unzip100Stop if the unpacked files add up to more than this, 1–1024 MB.
Most files (maxFiles)unzip1000Stop if the zip holds more files than this, 1–10,000.

Ports​

PortDescription
main (input)The step(s) it runs after.
outputThe zip (zip) or the unpacked files (unzip).

Output​

Zip

{ "file": { "fileName": "archive.zip", "contentType": "application/zip", "…": "…" }, "fileName": "archive.zip", "fileCount": 3, "size": 48213 }

Use {{ $nodes['Zip / Unzip'].file }} as an attachment or in the File step.

Unzip

{
"files": [ { "fileName": "rows.csv", "contentType": "text/csv", "…": "…" } ],
"entries": [ { "path": "data/rows.csv", "name": "rows.csv", "size": 1290, "contentType": "text/csv" } ],
"count": 1,
"totalSize": 1290,
"skipped": []
}
  • files — the unpacked files, in the zip's order, ready for Loop, Parse CSV, the File step and so on.
  • entries — the same files' path inside the zip, name, size and type (same order as files).
  • skipped — entries that were left out, with the reason.

Example​

Process every CSV in a zip that arrives by e-mail:

  1. Email Trigger
  2. Zip / Unzip — Operation Unzip a file, Zip file {{ $trigger.attachments[0].file }}, Only files matching *.csv
  3. Loop over {{ $nodes['Zip / Unzip'].files }} → Parse CSV with {{ $item }}

Notes​

  • Zip bombs are stopped before anything is unpacked. The step checks the zip's own table of contents first: the number of files, their total unpacked size, and how much each file expands — a file that would grow more than 200 times its packed size (and past 1 MB) is refused. While unpacking it also counts the real bytes, so a zip that misstates its sizes stops at the limit too.
  • Unsafe paths are skipped. Entries whose path leads outside the zip's folder (../, /etc/…, C:\…) are left out and listed in skipped. Folders themselves aren't returned; each file's folder is in entries[].path.
  • Password-protected zips aren't supported.
  • Large files don't sit in memory: stored files are read and written as streams, small unpacked files (up to 1 MB each, 4 MB together) are returned directly, and larger ones are kept in temporary storage and returned as file references — every step that takes a file accepts them.
  • Only .zip archives are supported (not .rar, .7z or .tar.gz).