core.create_file

Create File (core.create_file)

The reverse of Extract From File: build a real file from item data — CSV, Excel, JSON, plain text, or PDF — as a binary payload ready for a Drive upload, a Gmail attachment, or an HTTP upload.

Parameters

ParameterTypeDefaultDescription
formatcsv/xlsx/json/text/pdfcsv
file_namestringoutput.<ext>Expression-capable.
rowsexpression(input items)csv/xlsx/json: an explicit array of row objects ({{ $json.rows }}); blank = each input item's json is a row.
contentstringtext/pdf: the body to write.

Behavior

One run produces one file — the node aggregates all its input items into a single output item carrying the file under $binary.data, with {file_name, mime_type, size} in its json.

input   {"name": "Ada", "age": 36}   {"name": "Lin", "age": 29}
format  csv
output  one item · people.csv · "name,age\nAda,36\nLin,29"

CSV/XLSX column headers are the union of keys across all rows — an item missing a column gets an empty cell. Unicode content round-trips exactly.

Quirks & tips

  • One file per run, not per item. Need a file per item? Put the node in a Loop body with batch_size: 1.
  • The output item's json is file metadata — the input items' data lives in the file now. Merge upstream data back in with a Merge node if you need both.
  • JSON format writes the rows array as-is (pretty-printed) — for arbitrary structures, build the shape with Set/Code first.

Related

  • Extract From File — read it back.
  • Google Drive / Gmail Send — the usual destinations.
  • Base64 — when an API wants the file inline in a JSON body.