Aller au contenu
Agentic Workflowdocs
v0.8.2Installer gratuitement

nœuds / builtin / datatransformation

Convert to File

Turn items into a file (CSV, JSON, text, base64 or binary)

Données ExtensionApplication webDepuis 0.7.0

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

Turn your items into a file (CSV, JSON, text, base64 or binary) that later nodes can upload, attach or save.

Convert to File builds one file from all incoming items and attaches it to a single output item. It does not save the file anywhere: that is the job of the next node, such as Google Drive, an Http Request body, or a Slack or Gmail attachment.

The file name and type default to sensible values per format (data.csv and text/csv, data.json and application/json, data.txt and text/plain, data.bin and application/octet-stream).

  • Upload a scraped table to Google Drive as a real CSV file.
  • Attach generated JSON or text to a Slack message or an email.
  • Turn a base64 string returned by an API into a proper file.
  • To save generated text (CSV, JSON, Markdown) straight to your computer, use Save as File instead.
RéglageTypeCe que cela fait
Format ChoiceThe kind of file to produce. Options: CSV, JSON, Text, Base64, Binary. Par défaut : CSV
File name TextName of the produced file. Left empty, a sensible default per format is used.
MIME type TextContent type recorded on the file. Left empty, a sensible default per format is used. Required to be set explicitly for Base64.
Source Field TextField to read from the item. For Text: the text per item. For Base64: the field holding the base64 string. For Binary: the binary slot (defaults to "data") or a field holding the bytes.

How each Format builds the file:

  • CSV: one row per item, written the same way as the CSV node.
  • JSON: all items as a neatly indented JSON list.
  • Text: one line per item. With Source Field set, each line is that field’s value; otherwise text items are used as is and other items are written as JSON.
  • Base64: decodes the base64 text from Source Field (or the data field) of the first item. Base64 says nothing about the file type, so set MIME type, for example application/pdf.
  • Binary: re-wraps a file already attached to the first item (by default under data), keeping its own name and type unless you set new ones.
  • Output

Each output item has these fields:

FieldTypeWhat it holds
fileName Text
mimeType Text
format TextThe format the content was converted from
size Number
$binary Key-value pairs
Shape of an output item
{
"fileName": "…",
"mimeType": "…",
"format": "…",
"size": 0,
"$binary": {}
}

One item that carries the file under data, plus its name, type and size in bytes. In the next node, choose this file as the binary or attachment source.

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

  1. HTML Extract reads a product table from a page, one item per row.
  2. Convert to File with Format CSV and File name products.csv.
  3. Google Drive uploads the file using this node’s file as the source.
  • “No items to convert. Connect a node that produces items.” Nothing reached the node. Check that the previous node returns data.
  • “Base64 needs a base64 string.” Name the field holding the base64 text in Source Field, or put it in a data field, and make sure it is text.
  • “No binary to wrap.” With Binary, the first item has no attached file. Connect a node that outputs a file, or name the field holding it in Source Field.
  • The file opens with the wrong app or type. Set MIME type yourself. This matters most for Base64, which otherwise becomes application/octet-stream.
Modifier cette page

Dernière mise à jour :

Was this page useful?
Demander à Aria à propos de Convert to File