Actions5
Extract from Document
AI-generatedSummary
Extract structured data from document files (PDF, CSV, TXT, HTML, etc.) provided either as binary data from a previous node or by downloading from a URL, using AI-powered extraction with optional custom output field definitions.
Inputs
- Input Method (required) — Provide the document file either as Binary Data (field name specified by Input Binary Field) or via a File URL to download.
- Input Binary Field (required) — Name of the binary property containing the file from the previous node when using Binary Data input method.
- File URL (required) — URL of the file to extract data from when using URL input method.
- Define Output Fields — Enable to specify which fields to extract from the document for tailored data extraction.
- Schema Mode — Choose Simple (Field Builder) to define fields individually or Advanced (JSON Schema) to provide a full JSON schema if Define Output Fields is enabled.
- Output Fields — List of fields with name, type, and optional description to extract in Simple Schema Mode.
- JSON Schema — JSON schema describing the structure and fields to extract in Advanced Schema Mode.
- Options - Include Metadata — Whether to include metadata such as filename, file type, and status in the output.
- Options - Simplify — Whether to return a simplified extraction result instead of the raw API response.
Output shape
a list of JSON items, each containing extracted data fields; optionally includes metadata or raw API response depending on options
Output is an array with one item per input. Each item contains extracted data under 'extracted_data' or directly in the root JSON. If 'Include Metadata' is enabled, status, filename, and file type are included. If 'Simplify' is false, raw API response is included. Errors related to extraction or downloads are surfaced as item errors unless 'Continue On Fail' is enabled.
Examples
Example 1: Extract simple fields from a PDF uploaded as binary
Set Input Method to 'Binary Data', specify 'data' as binary field, enable Define Output Fields with Simple Schema Mode, and add fields like 'invoice_number' and 'total'.
Example 2: Extract data from a document available at a URL with advanced schema
Set Input Method to 'URL', provide File URL, enable Define Output Fields with Advanced Schema Mode, and supply a JSON schema defining expected fields.