Document Processing Node
A supplier emails a PDF invoice. You need the vendor, the total and the line items right now, and you don't need to keep the file. That's what the Document Processing node is for: point it at a document, choose what to pull out, and the extracted data flows to the next step as a variable.
Before you start
The most common setup is a Trigger that brings in a document, followed by this node. It's also worth knowing how it differs from a Knowledge Base:
- A Knowledge Base upload stores and indexes a document so agents can search it later. The KB Index node does that from inside a workflow.
- Document Processing reads a document once and hands back its contents now. Nothing is stored.
Adding the node
- Open your agent under Agents and edit its canvas.
- Click + after the step that supplies the document (usually the Trigger).
- In the Documents group, pick the entry that matches your file (see the Documents group). Every entry adds the same node with different settings already filled in.
- Open the node and set its Input.
Options

| Field | What it does | Options | Default | Shown when |
|---|---|---|---|---|
| Input source | Where the data comes from. Use a URL for files arriving via a Webhook trigger. | File URL (download) · Raw text · Base64 / data URL | url | |
| Input | A file URL, a base64 blob, or raw text. For a Webhook trigger, the body's fields are available flat — e.g. a { "file_url": … } body → {{ file_url }}. Supports {{variables}} from earlier steps. | |||
| MIME type (optional) | Hint for URL / base64 inputs when the type can't be detected. | |||
| What to extract | Raw returns the extracted text verbatim (audio transcript, spreadsheet dump, document text) with no structured extraction. | Use-case template · Custom fields · Raw text / transcript | use_case | |
| Use case | Which document use-case to apply (Invoice, Resume, Product Catalog, …). | What to extract is Use-case template | ||
| Fields to extract | Define the fields to pull out of the document. | What to extract is Custom fields | ||
| Extract a list (many rows) | Return one row per subject the document describes (e.g. one per line item). | false | What to extract is Custom fields | |
| JSON Schema (advanced, optional) | Paste a JSON Schema to override the fields table. | What to extract is Custom fields | ||
| Extraction model | Which model reads the document/audio for this node — a Gemini vision model, or Google Cloud STT for audio transcription. Empty = platform default (gemini-2.5-flash). | Gemini 3.8 Flash · Gemini 3.7 Flash · Gemini 3.6 Flash · Gemini 3.5 Flash · Gemini 3.5 Flash Lite · Gemini 3.1 Flash Lite · Gemini 2.5 Flash · Gemini 2.5 Flash Lite · Google Cloud STT | ||
| Service tier | Flex costs less but is served best-effort: under provider demand spikes it returns 503 and retries, so extraction can take minutes. Standard is scheduled immediately. | Flex — cheaper, best-effort · Standard — scheduled immediately | flex | |
| Also return the raw extracted text | false | |||
| Output variable | Where to store { fields, rows, line_items, clauses, metadata }. Defaults to document. |
The Use Case field's Documented fields panel previews every field, table column and category that type returns, with a Full field reference link.
Extraction Model is optional — leave it empty to use the built-in default. It only offers models that can read documents (Gemini vision models, or Google Cloud STT for audio); Activate refuses any other pick by name.

Pointing at the file
Click {x} next to Input to insert a variable.
- When the file arrived as an attachment (an email PDF, a WhatsApp or SMS media message, a Web Chat upload), use
{{ trigger.attachments[0].url }}. Use[1],[2], … for more files. - A Webhook trigger makes each field of the incoming request available directly. If the request body has a
file_urlfield, use{{ file_url }}.
For a PDF, image or scan, Perfox reads the text for you (including scanned pages) before extracting fields.
Downloads are protected
With File URL (download), Perfox fetches the file through a guarded connection that blocks internal and private addresses, so a document link can't be used to reach somewhere it shouldn't.
What you get back
The result lands in your output variable (default __document__) as an object with any of these, depending on the document and mode:
| Key | Present when |
|---|---|
fields | The document has one set of header or summary values. |
rows | You ticked Extract a list (many rows). |
line_items | The document has a repeating table, such as invoice lines or lab results. |
clauses | A contract or audit document, with each clause sorted into a category. |
text | What to Extract is Raw text / transcript, or you ticked Also return the raw extracted text. |
A field is filled only when the document actually states it. Nothing is guessed. If a document can't be read, the run doesn't stop: the output variable carries an error instead, so a later step can react. The step is marked as an error, so the run shows Completed with errors, and a scheduled or webhook run alerts your workspace.
The Documents group
The Documents group in the node picker offers ready-made entries. Each one adds a Document Processing node with What to Extract and Use Case already set.
| Entry | What it's set to extract |
|---|---|
| Document Processing | Use-case template, with no type picked yet. |
| Audio → Transcript | Raw text: the spoken transcript of a call, meeting or voice note. |
| Spreadsheet → Text | Raw text: the rows and columns of an XLSX or CSV file. |
| File → Text (raw) | Raw text from any file: PDF, image, audio or spreadsheet. |
| Medical Report | Demographics, a table of observations (value, unit, reference range, flag) and the interpretation. |
| Invoice / AP | Header fields plus the line-item table. |
| Resume / ATS | Candidate name, years of experience, skills, work authorisation. |
| Contract / Legal | Parties, contract type, governing law, effective and expiry dates, auto-renewal and notice days, value. |
| Product Catalog | One row per priced product or variant. |
| Financial Statements | Reporting entity, period, statement type, currency, and revenue and expense lines. |
| Insurance Claim | Claim and policy numbers, claimant, date of loss, peril and claimed amount. |
| Compliance / Audit | Findings with severity, status and the control each one references. |
| RFP / Tender | Requirements with their ids, obligation level, section reference and win themes. |
| Research Paper | Title, authors, year and venue, plus methods and findings. |
| Custom fields | Your own field list. |
The full field list for every type is in Document Parser Fields.
Worked example: invoice routing at Acme Store
Setup. Asha, an ops builder at Acme Store, builds a workflow with an Email trigger followed by an Invoice / AP entry from the Documents group. She sets Input to {{ trigger.attachments[0].url }}.
Action. A supplier emails a PDF invoice. The workflow starts and the node downloads the attachment and extracts the invoice fields.
Result. {{ document }} now holds fields.vendor_name, fields.total_amount and a line_items list with one row per product line. An HTTP Request step sends them to Acme's accounts system.
What just happened. Perfox read the PDF and passed the invoice fields forward without storing the file and without an AI Agent in the workflow.
Worked example: a lab report over WhatsApp at Acme Diagnostics
Setup. Asha wants patients to share previous blood test reports over WhatsApp so the booking agent can recommend a follow-up. After the WhatsApp trigger she adds a Medical Report entry with Input set to {{ trigger.attachments[0].url }}, then the AI Agent.
Result. The node puts the report's observations in {{ document.line_items }}, for example:
json
{
"fields": { "patient_name": "Priya Sharma", "report_date": "2026-05-14" },
"line_items": [
{ "test_name": "Hemoglobin (Hb)", "observed_value": 11.2, "unit": "g/dL", "reference_range": "12.0 - 15.0", "interpretation": "Low" },
{ "test_name": "Fasting Blood Sugar", "observed_value": 105, "unit": "mg/dL", "reference_range": "70 - 99", "interpretation": "High" }
]
}The agent then explains: "Priya, your previous test showed slightly low hemoglobin and borderline fasting sugar. We recommend our Anemia & Diabetes Monitoring Panel."
Activates on its own
Because Document Processing is a self-contained step, a workflow made of just Trigger → Document Processing → HTTP Request can be activated with no AI Agent in it.
Same extraction, three ways
The same extraction is also available as the Extract Document action, which an AI Agent calls during a conversation, and through the Perfox API for your own backend. See API Keys.
Next steps
- Trigger Nodes: bring documents in, including email attachments and webhook file URLs.
- Document Parser Fields: every field each document type returns.
- KB Index: store and index content into a Knowledge Base folder instead.