Skip to main content

Document / PDF Node

Flow node

What it does​

The Document node works in one of two modes:

  • Parse: a PDF in, a row out with the PDF's text and page count.
  • Render: a row and a template in, a PDF out.

Both modes can read from or write to a file connection: S3, Azure Blob, Google Drive, OneDrive, SharePoint, Dropbox, SFTP or FTP.

When to use​

  • You need the text of PDFs such as invoices, contracts or resumes, so later nodes can work with it.
  • You need a PDF per row, such as a receipt, statement or work order, returned in the row or uploaded to a file store.
  • To process an inbound PDF and send a confirmation PDF, chain a Parse node and a Render node.

Configure​

Select the node and press Configure to open Configure Document. Save keeps the dialog open, Done saves and closes, and Cancel puts back what you had at the last save. A message confirms each save.

Mode: Parse or Render. The sections below change with the mode.

Parse​

  • PDF source column: the row column holding the PDF, as bytes or base64 text. The default is pdfBuffer. The columns pdfBuffer and pdfBase64 are also read.

  • Extraction quality columns: optional columns added to each row.

    ColumnMeaning
    char_countCharacters extracted.
    chars_per_pageCharacters per page, rounded. A scanned page reads 0.
    text_item_countText items found. 0 means the pages have no text layer.
  • Send an empty extraction to the error port: a scanned PDF has no text. With this off, it leaves on out with empty text. With it on, it leaves on error with empty_extraction.

Test with a document: pick a PDF from your computer to see what the next node would receive: every column, the text and the port. It uses the node's current settings. Nothing is saved or uploaded, and no run is created. Up to 8 MB per file. The document is read on the project's runtime; a project on a Private Agent that polls for work shows a message instead.

Render​

  • Template: the page content. {{column}} inserts a row value; dotted paths such as {{customer.name}} work, and a missing column becomes empty.
  • Template type:
    • Text: each row renders onto an A4 page in Helvetica.
    • HTML: full HTML and CSS, for layout, fonts and images. If HTML rendering is not available on the runtime, every row leaves on error with html_renderer_not_configured. Use Text in that case.
  • Show substitution preview: shows each {{column}} token as a bracketed name.

File connection​

Optional in both modes, and closed until you open it. Its header names the connection that is set.

  • Parse: Source connection, chosen from your connections, and Source path column, the row column holding each file's path in that connection.
  • Render: Target connection, chosen from your connections, and Target path template, such as receipts/{{orderId}}.pdf.

Set both fields of a pair, or neither. The run preflight stops a run with only one set.

Ports​

PortDirectionKindNotes
inindataRows carrying the PDF, or the data to render.
outoutdataThe parsed text, or the rendered PDF.
erroroutcontrolRows that could not be parsed or rendered, with the reason.

Output columns​

Parse output

ColumnMeaning
name, sourceFrom the input row. source is the file path when the PDF came from a connection.
pageCountNumber of pages.
textThe extracted text, pages joined by line breaks.
metaSize, producer, creator and title, where the PDF has them.
ai_readyAlways false.

Parse replaces the row with these columns, plus any quality columns you turned on. Downstream field pickers list exactly these.

Render output

ColumnMeaning
nameFrom the input row, or document_<n>.pdf.
sourceFrom the input row.
pdfBase64The PDF as base64 text.
sizeBytesThe PDF's size.
pagesEmpty.
blobRefThe uploaded file's reference, when a target connection is set.

Examples​

Sort inbound documents.

Parse turns each PDF into a row with its text. The AI Prompt node classifies the text as invoice, credit_note or other, and a Transform and Load write the file name, page count and category to a register.

A receipt per order. Source (orders) > Document (Render, Text, template Receipt for order {{orderId}}. Total: {{total}}, Target connection set, Target path template receipts/{{orderId}}.pdf) > Notification announcing the batch.

Store statements. Document (Render, HTML, Target connection set, Target path template statements/{{accountId}}.pdf). Each row's blobRef records where its file was written.

Troubleshooting​

SymptomCauseWhat to do
text is emptyThe PDF is a scan with no text layer.Turn on text_item_count to confirm, and Send an empty extraction to the error port to separate these rows.
no_pdf_payload on errorThe row has no PDF in the source column and no connection path.Check PDF source column, or set the file connection fields.
html_renderer_not_configured on errorHTML rendering is not available on the runtime.Use Text.
An error naming a connection idThe connection does not exist or the run cannot use it.Check the connection id on the Connections page.
The run will not startRender mode has an empty template, or only one of the target pair is set.Write a template, and set both target fields or neither.