extract node uses AI to extract structured data from documents according to a JSON Schema. It works with both raw documents (via VLM) and parsed DocumentIR (via LLM).
Basic Usage
Configuration Options
Options Reference
Input Mode
TheinputMode option controls what input the extract node uses for extraction. This is one of the most important configuration options for optimizing accuracy and cost.
Mode Options
Auto Mode (Default)
Auto mode intelligently selects the best extraction path:- If DocumentIR + source available + VLM provider +
preferVisual: true→ir+source - If only DocumentIR available →
ir - If only FlowInput (raw document) + VLM provider →
source
IR Mode (Text-Only)
Use parsed text only, ignoring visual context:- Text-heavy documents (contracts, reports)
- Cost optimization (LLM is cheaper than VLM)
- When OCR accuracy is sufficient
IR+Source Mode (Hybrid)
Combine parsed text with visual context for maximum accuracy:- Complex layouts (tables, forms with checkboxes)
- Documents with visual elements (signatures, stamps)
- When highest accuracy is required
Source Mode (Direct VLM)
Skip parsing entirely, extract directly from raw document:- Simple, well-structured documents
- When OCR adds no value (clean PDFs)
- Fastest processing time
Using Original Source in forEach
When processing split documents, useuseOriginalSource to reference the full document instead of individual segments:
Input Types
The extract node accepts different input types depending on the configured mode:Raw Documents (VLM)
Direct extraction from PDFs or images:Parsed Documents (LLM)
Extract from previously parsed DocumentIR:Schema Definition
Basic Schema
Schema Registry Reference
Use registered schemas:Enhanced Schema
Include examples and extraction guidance:Citation Tracking
Track which parts of the source document contributed to each field:Consensus Voting
Run extraction multiple times and vote on results:Extended Reasoning
Enable chain-of-thought reasoning for complex extractions:Custom Instructions
Add extraction guidance:Type-Safe Extraction
Use TypeScript generics for typed output:Error Handling
Extraction may fail if:- Document cannot be read
- Schema cannot be satisfied
- Provider returns invalid response
Next Steps
Schemas
Learn about schema definition
Consensus Voting
Improve accuracy with multi-run voting
Citations
Track extraction sources
Providers
Configure LLM/VLM providers