Zum Inhalt

Files

Compression

Packs attachments into a ZIP archive and unpacks ZIP archives into items or attachments; compresses and decompresses single attachments with GZip.

Inputs: main · Outputs: main

Parameter Type Description
Operation
operation
one of: zip, unzip, gzip, gunzip What to do with the attachments.
zip: Pack attachments into a ZIP archive.
unzip: Unpack a ZIP archive into its files.
gzip: Compress one attachment into a .gz file.
gunzip: Decompress a .gz attachment.
Default: zip.
Zip
scope
one of: eachItem, allItems One archive per item, or one of all items.
eachItem: One archive per item with its attachments.
allItems: One archive with the attachments of all items.
Only when Operation is zip. Default: eachItem.
Archive name
fileName
text File name of the archive, e.g. invoices.zip. Only when Operation is zip. Supports expressions.
Unzip into
output
one of: itemPerEntry, attachments One item per file, or all files as attachments of the input item.
itemPerEntry: One item per file in the archive, the file attached as data.
attachments: The input item with every file of the archive as an attachment.
Only when Operation is unzip. Default: itemPerEntry.
Attachments
binaryProperty
text Zip: names of the attachments to pack, separated by commas; empty packs all. Otherwise the one attachment to read, data if empty. In Advanced.
Max size (MB)
maxMegabytes
integer Stop when the unpacked content gets larger; protects against archives that unpack to huge sizes. Only when Operation is unzip or gunzip. In Advanced. Default: 500.
Result attachment
outputProperty
text Name of the attachment with the result, data if empty. Only when Operation is zip or gzip or gunzip. In Advanced.
Example: Pack the files of all items into one ZIP

E.g. after Read File with invoices/*.pdf: one item comes out with the archive attached as data.

Parameters:

{
  "operation": "zip",
  "scope": "allItems",
  "fileName": "invoices.zip"
}

Input:

[
  {
    "fileName": "2025-001.pdf",
    "$binary": {
      "data": {
        "fileName": "2025-001.pdf",
        "mimeType": "application/pdf"
      }
    }
  },
  {
    "fileName": "2025-002.pdf",
    "$binary": {
      "data": {
        "fileName": "2025-002.pdf",
        "mimeType": "application/pdf"
      }
    }
  }
]

Output:

[
  {
    "count": 2,
    "entries": 2,
    "$binary": {
      "data": {
        "fileName": "invoices.zip",
        "mimeType": "application/zip"
      }
    }
  }
]
Example: Unpack a ZIP archive

Every file of the archive becomes an item with the file attached as data, e.g. to read each one with Extract from File.

Parameters:

{
  "operation": "unzip"
}

Input:

[
  {
    "$binary": {
      "data": {
        "fileName": "invoices.zip",
        "mimeType": "application/zip"
      }
    }
  }
]

Output:

[
  {
    "fileName": "2025-001.pdf",
    "path": "2025-001.pdf",
    "size": 14,
    "modifiedAt": "2026-11-11T08:00:00.0000000+00:00",
    "archive": "invoices.zip",
    "$binary": {
      "data": {
        "fileName": "2025-001.pdf",
        "mimeType": "application/pdf"
      }
    }
  },
  {
    "fileName": "2025-002.pdf",
    "path": "2025-002.pdf",
    "size": 14,
    "modifiedAt": "2026-11-11T08:00:00.0000000+00:00",
    "archive": "invoices.zip",
    "$binary": {
      "data": {
        "fileName": "2025-002.pdf",
        "mimeType": "application/pdf"
      }
    }
  }
]
Example: Compress a file with GZip

The attachment is replaced by its compressed version; the name gets .gz.

Parameters:

{
  "operation": "gzip"
}

Input:

[
  {
    "$binary": {
      "data": {
        "fileName": "export.csv",
        "mimeType": "text/csv"
      }
    }
  }
]

Output:

[
  {
    "$binary": {
      "data": {
        "fileName": "export.csv.gz",
        "mimeType": "application/gzip"
      }
    }
  }
]

Convert to File

Turns items into a file attachment, e.g. to send it by mail, upload it or save it with Write File: CSV, JSON, XML, text, and Excel with the Office plugin.

Inputs: main · Outputs: main

Parameter Type Description
Format (required)
format
text Format of the file. Excel needs the Office plugin.
Files
mode
one of: allItems, eachItem One file of all items, or one file per item.
allItems: One file with all items; CSV and Excel always do this.
eachItem: One file per item, attached to the item (JSON, XML, Text).
Only when Format is json or xml or text. Default: allItems.
File name
fileName
text Name of the file, e.g. orders.csv; empty: data plus the extension of the format. Supports expressions.
Header row
header
true/false Write the column names as the first row. Only when Format is csv or xlsx. Default: true.
Delimiter
delimiter
text Character between the columns, e.g. , or ; or \t. Only when Format is csv.
Sheet
sheet
text Name of the sheet, e.g. Orders. Only when Format is xlsx. Supports expressions.
Sheet per field
sheetPerField
text One sheet per value of this field, e.g. region makes a sheet per region. Only when Format is xlsx. In Advanced.
Root element
rootElement
text Name of the outer element, e.g. orders; for one file per item, the element of the item. Only when Format is xml. Supports expressions.
Item element
itemElement
text Element of each item in one file of all items, e.g. order. Only when Format is xml.
Text field
textField
text Field of the items to write, one item per line, e.g. line. Only when Format is text.
Encoding
encoding
text Character set of the file, e.g. utf-8, windows-1252, iso-8859-1, utf-16. Only when Format is csv or json or xml or text. In Advanced.
Attachment name
binaryProperty
text Name of the new attachment, under which later nodes find the file. In Advanced.
Example: All items as one CSV file

One item comes out with the file attached as data, e.g. for Send Email or Write File.

Parameters:

{
  "format": "csv",
  "fileName": "orders.csv"
}

Input:

[
  {
    "id": 1,
    "customer": "Anna"
  },
  {
    "id": 2,
    "customer": "Ben"
  }
]

Output:

[
  {
    "format": "csv",
    "count": 2,
    "$binary": {
      "data": {
        "fileName": "orders.csv",
        "mimeType": "text/csv"
      }
    }
  }
]
Example: One JSON file per item

Every item keeps its fields and gets its own file, named with an expression.

Parameters:

{
  "format": "json",
  "mode": "eachItem",
  "fileName": "order-{{ $json.id }}.json"
}

Input:

[
  {
    "id": 1,
    "customer": "Anna"
  },
  {
    "id": 2,
    "customer": "Ben"
  }
]

Output:

[
  {
    "id": 1,
    "customer": "Anna",
    "$binary": {
      "data": {
        "fileName": "order-1.json",
        "mimeType": "application/json"
      }
    }
  },
  {
    "id": 2,
    "customer": "Ben",
    "$binary": {
      "data": {
        "fileName": "order-2.json",
        "mimeType": "application/json"
      }
    }
  }
]

Extract from File

Turns an attached file (from a webhook, a mail, an HTTP response, Read File) into items: CSV, JSON, XML, text, and Excel with the Office plugin. Runs once per input item.

Inputs: main · Outputs: main

Parameter Type Description
Format (required)
format
text Format of the file. Excel needs the Office plugin.
Output
output
one of: items, field How the rows come out.
items: One item per row or object; the fields of the input item are not kept.
field: The input item stays one item and gets all rows or objects as a list in one field.
Default: items.
Field
field
text Name of the field that gets the list, e.g. rows. Only when Output is field.
Header row
header
true/false The first row holds the column names; otherwise the columns are column1, column2, …. Only when Format is csv or xlsx. Default: true.
Delimiter
delimiter
text Character between the columns, e.g. , or ; or \t; empty detects it from the first row. Only when Format is csv.
Sheet
sheet
text Name of the sheet to read; empty reads the first. Only when Format is xlsx. Supports expressions.
Item element
itemElement
text Every element of this name becomes an item, e.g. order; empty makes the whole document one item. Only when Format is xml.
Always array
alwaysArray
text Element names, separated by commas, that become lists even when they occur once, e.g. line. Only when Format is xml. In Advanced.
Encoding
encoding
text Character set of the file, e.g. utf-8, windows-1252, iso-8859-1; a byte order mark wins. Only when Format is csv or json or xml or text. In Advanced.
Attachment name
binaryProperty
text Name of the attachment to read; data unless an earlier node named it differently. In Advanced.
Example: Rows of an attached CSV file as items

E.g. after a Webhook Trigger with an upload or an Email Trigger: every row becomes an item. All values are text.

Parameters:

{
  "format": "csv",
  "delimiter": ";"
}

Input:

[
  {
    "$binary": {
      "data": {
        "fileName": "orders.csv",
        "mimeType": "text/csv"
      }
    }
  }
]

Output:

[
  {
    "id": "1",
    "customer": "Anna"
  },
  {
    "id": "2",
    "customer": "Ben"
  }
]
Example: A JSON array into one field of the item

With Output 'All rows in one field' the item keeps its fields and gets the list, e.g. to count or loop over it later.

Parameters:

{
  "format": "json",
  "output": "field",
  "field": "lines"
}

Input:

[
  {
    "order": "A-17",
    "$binary": {
      "data": {
        "fileName": "lines.json",
        "mimeType": "application/json"
      }
    }
  }
]

Output:

[
  {
    "order": "A-17",
    "lines": [
      {
        "sku": "P-1",
        "qty": 2
      },
      {
        "sku": "P-7",
        "qty": 1
      }
    ],
    "$binary": {
      "data": {
        "fileName": "lines.json",
        "mimeType": "application/json"
      }
    }
  }
]

Read File

Reads files from a folder of the server: as an attachment, as text, or as items from JSON or CSV. Runs once per input item.

Inputs: main · Outputs: main

Parameter Type Description
Folder (required)
folder
text Where the files are: one of the folders the administrator has set up for workflows.
Path (required)
path
text File inside the folder, e.g. report.pdf; * and ? in the file name read all matching files, e.g. orders/*.csv. Supports expressions.
Read as
format
one of: binary, text, json, csv What becomes of the file content.
binary: The file as an attachment, plus its name, size and date; for PDFs, images, ZIP archives.
text: The content as text in the field text.
json: Items from the JSON: an object becomes one item, an array one item per element.
csv: One item per row; the first row holds the column names.
Default: binary.
CSV delimiter
csvDelimiter
text Character between the columns, e.g. , or ; or \t for tab. Only when Read as is csv.
Include subfolders
includeSubfolders
true/false Only with * or ? in the path: search the subfolders too, e.g. orders/*.csv then also finds orders/2025/a.csv. In Advanced. Default: false.
Attachment name
binaryProperty
text Name under which later nodes find the file, e.g. in Write File or Send Email. Only when Read as is binary. In Advanced.
Example: Read a CSV file as items

Every row becomes an item; the first row holds the column names. All values are text.

Given the file orders/2025-11.csv in the folder:

id;customer;amount
1;Anna;120.50
2;Ben;80.00

Parameters:

{
  "folder": "files",
  "path": "orders/2025-11.csv",
  "format": "csv",
  "csvDelimiter": ";"
}

Output:

[
  {
    "id": "1",
    "customer": "Anna",
    "amount": "120.50"
  },
  {
    "id": "2",
    "customer": "Ben",
    "amount": "80.00"
  }
]
Example: Read a PDF as an attachment

The file is attached to the item as data, e.g. to send it by mail or upload it; the item tells its name, size and date.

Given the file invoices/2025-001.pdf in the folder:

%PDF-1.7 (sample)

Parameters:

{
  "folder": "files",
  "path": "invoices/2025-001.pdf",
  "format": "binary"
}

Output:

[
  {
    "fileName": "2025-001.pdf",
    "path": "invoices/2025-001.pdf",
    "size": 17,
    "modifiedAt": "2026-11-11T08:00:00.0000000Z",
    "$binary": {
      "data": {
        "fileName": "2025-001.pdf",
        "mimeType": "application/pdf"
      }
    }
  }
]
Example: Read all text files of a folder

With * in the path every matching file is read, one item per file, in the order of their names.

Given the file notes/a.txt in the folder:

Call Anna

Given the file notes/b.txt in the folder:

Order paper

Parameters:

{
  "folder": "files",
  "path": "notes/*.txt",
  "format": "text"
}

Output:

[
  {
    "fileName": "a.txt",
    "path": "notes/a.txt",
    "size": 9,
    "modifiedAt": "2026-11-11T08:00:00.0000000Z",
    "text": "Call Anna"
  },
  {
    "fileName": "b.txt",
    "path": "notes/b.txt",
    "size": 11,
    "modifiedAt": "2026-11-11T08:00:00.0000000Z",
    "text": "Order paper"
  }
]

Write File

Writes files into a folder of the server: attachments or text (one file per item), or all items as JSON or CSV (one file).

Inputs: main · Outputs: main

Parameter Type Description
Folder (required)
folder
text Where to write: one of the folders the administrator has set up for workflows.
Path (required)
path
text File inside the folder, e.g. export/orders.csv; missing subfolders are created. Supports expressions.
Write
content
one of: binary, text, itemsAsJson, itemsAsCsv What goes into the file.
binary: One file per item: the item's attachment, e.g. a PDF from Read File or a mail.
text: One file per item with the text below.
itemsAsJson: One file with all items as a JSON array.
itemsAsCsv: One file with all items as CSV rows, one column per field.
Default: binary.
Text
text
text Content of the file, e.g. Order {{ $json.id }} received. Only when Write is text. Supports expressions.
CSV delimiter
csvDelimiter
text Character between the columns, e.g. , or ; or \t for tab. Only when Write is itemsAsCsv.
If the file exists
ifExists
one of: overwrite, append, fail What happens when the file is already there.
overwrite: Replace the file.
append: Add to the end of the file; CSV adds rows without a second header, JSON can't be appended.
fail: Stop with an error and keep the file.
Default: overwrite.
Attachment name
binaryProperty
text Name of the attachment to write; data unless an earlier node named it differently. Only when Write is binary. In Advanced.
Example: Save all items as a CSV file

One file with a row per item. The output is one item that tells where the file is and how large it is.

Parameters:

{
  "folder": "files",
  "path": "export/orders.csv",
  "content": "itemsAsCsv"
}

Input:

[
  {
    "id": 1,
    "customer": "Anna"
  },
  {
    "id": 2,
    "customer": "Ben"
  }
]

Output:

[
  {
    "folder": "files",
    "path": "export/orders.csv",
    "size": 28
  }
]
Example: One text file per item

The path and the text use expressions, so every item gets its own file. The items go on with the field writtenFile.

Parameters:

{
  "folder": "files",
  "path": "messages/{{ $json.id }}.txt",
  "content": "text",
  "text": "Order {{ $json.id }} received"
}

Input:

[
  {
    "id": 17
  },
  {
    "id": 18
  }
]

Output:

[
  {
    "id": 17,
    "writtenFile": {
      "folder": "files",
      "path": "messages/17.txt",
      "size": 17
    }
  },
  {
    "id": 18,
    "writtenFile": {
      "folder": "files",
      "path": "messages/18.txt",
      "size": 17
    }
  }
]
Example: Archive an attachment

Saves the attachment of each item, e.g. a PDF from Read File or from a mail, under its own name.

Parameters:

{
  "folder": "files",
  "path": "archive/{{ $json.fileName }}",
  "content": "binary"
}

Input:

[
  {
    "fileName": "2025-001.pdf",
    "$binary": {
      "data": {
        "fileName": "2025-001.pdf",
        "mimeType": "application/pdf"
      }
    }
  }
]

Output:

[
  {
    "fileName": "2025-001.pdf",
    "writtenFile": {
      "folder": "files",
      "path": "archive/2025-001.pdf",
      "size": 17
    },
    "$binary": {
      "data": {
        "fileName": "2025-001.pdf",
        "mimeType": "application/pdf"
      }
    }
  }
]