Skip to content
Agentic Workflowdocs
v0.8.2Install free

nodes / builtin / datatransformation

Extract From File

Turn a file into items, with the format auto-detected

Data ExtensionWeb app

Turn a downloaded or picked file (CSV, JSON, XML, text or PDF) into workflow items.

Extract From File reads the file attached to the incoming item and returns its contents as a list of items. What you get depends on the format:

  • CSV: one item per row, keyed by the header row. Empty rows are skipped.
  • JSON: an array gives one item per element; a single object gives one item; a plain value gives { "value": ... }.
  • XML: the whole document as one object. Attributes get an @ prefix and repeated elements become lists.
  • Text: one item per line, each as { "text": "..." }.
  • PDF: one item with the extracted text and pageCount.

The file can come from an Http Request download (stored under $binary) or from Local File Read (name, type, content). Each incoming item is treated as its own file. Excel files (XLSX) are not supported.

With Format on Auto-detect, the node looks at the file’s type first (for example text/csv or application/pdf), then the file name’s extension (.csv, .json, .xml, .pdf, .txt), then the first characters of the content (%PDF, {, [ or <).

  • Read rows from a CSV or JSON file that an Http Request downloaded.
  • Let someone pick a file with Local File Read and process each row or line.
  • Get the text out of a PDF without caring about page settings. For per-page text or a custom output field, use PDF Parser instead.
  • For CSV with a different delimiter or no header row, use the CSV node instead: this node always splits on commas and treats the first row as headers.
SettingTypeWhat it does
Format ChoiceThe file format to decode, or auto-detect it. Options: Auto-detect, CSV, JSON, XML, Text, PDF. Default: Auto-detect
Binary Field TextWhich $binary key on the incoming item holds the file. Default: data

Binary Field only matters for files from Http Request, which stores a download under data by default. Items without a binary are read from their content or text field instead.

From Local File Read, set Read as to Text for CSV, JSON, XML and text files, and to Data URL or Base64 for PDFs.

  • Output

The output is always a list. CSV, JSON arrays and text files usually give many items, so the next node runs once per row or line. XML, PDF and single-object JSON give one item.

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

  1. An Http Request downloads https://example.com/prices.csv.
  2. Extract From File with Format on Auto-detect turns it into one item per row.
  3. Filter keeps rows where {{ $input.stock }} is 0.
  4. Slack posts the out-of-stock products.
  • “Could not detect the file format. Set the Format field manually (CSV, JSON, XML, Text or PDF).” The file had no useful type, extension or recognisable start. Choose the format in Format.
  • “No file to extract. Attach a binary under $binary, or provide a file from Local File Read.” The incoming item has no file under Binary Field and no content or text field. Check the key name, or connect the node that produced the file.
  • “Could not parse JSON: …” The file is not valid JSON, or auto-detect guessed JSON wrongly. Fix the file or pick the right Format.
  • “Field “data” could not be decoded as base64 PDF data.“ A PDF was read as Text by Local File Read. Set Read as to Data URL.
  • A .tsv file comes out as one column. Tab-separated files are detected as CSV but split on commas. Use the CSV node with a tab delimiter.
  • PDF Parser: PDF text with per-page options.
  • CSV: CSV with custom delimiters, or writing CSV.
  • XML: convert XML text to JSON and back.
  • Local File Read: let the user pick a file.
Edit page

Last updated:

Was this page useful?
Ask Aria about Extract From File