Docs
Sign in

File Extraction

File Extraction reads a file and gives you its text and details, such as the number of pages.

Screenshot to add: The File Extraction settings panel with file type, source, name and output key.

When to use it

Use it to read the contents of a document, such as an invoice PDF, before you pass it to an agent or another node. In the palette it is described as "Extract text & metadata from a file".

Settings

FieldWhat it doesNotes
File typeWhat kind of file it isPDF (default), DOCX, TXT, XLSX, CSV, PNG image, JPG / JPEG image, JSON, XML, Other
File sourceWhere the file comes fromFile URL (default) or Base64 content
File nameThe file's nameJinja2 supported. Placeholder e.g. invoice.pdf or {{ filename }}
File URLThe address of the fileShown when the source is File URL. Placeholder https://… or {{ file_url }}
Base64 contentThe file's bytes as base64Shown when the source is Base64 content. Placeholder Base64 data or {{ file_b64 }}
Output keyWhere the result is savedDefault extracted_file

Inputs and outputs

  • Input: one connection at the top.
  • Output: one connection at the bottom. Later nodes read the result through the output key, for example {{ extracted_file.text }} and {{ extracted_file.metadata.page_count }}.

Example

Illustrative. Set File source to File URL, File URL to {{ file_url }}, and use {{ extracted_file.text }} in the next node.

Tips

  • Set File type to match the file.
  • Use Base64 content when the file arrives inside an earlier node's output rather than at a web address.