Skip to main content
Finance & Accounting

Extraction is easy; knowing the extraction was wrong is the requirement

Invoices arrive in any layout a supplier invents. Reading them is mechanical work that takes a bookkeeper's morning and produces a table that is already on the page.

The danger is not that extraction fails in an obvious way. It is that it succeeds acceptably: 1,240 rather than 1,420, in a document nobody rechecks because the overall total was correct.

That is why arithmetic is a check, not a formatting step. Line items must add up to the stated subtotal. Tax must match the rate for the jurisdiction. Subtotal plus tax must equal the total. If an invoice fails any of these checks, it has been misread or it is wrong. In either case a person has to handle it.

Currency and date are the fields most often assumed. If an invoice in a second currency is posted at the wrong rate, the error is found only at reconciliation, weeks later.

How the ActionFlow runs on the canvas

Invoices arrive as PDFs through an Email node that reads the accounts inbox, or through a Document Upload node when someone submits a document directly.

An Extract Data node selects the pages that contain line items from a multi-page document. A PDF4me node extracts the document contents. Both run before any model sees the file.

A Generate Object node returns supplier, invoice number, date, currency, an array of line items, tax lines, and the stated totals. Each field comes from the document or is left blank. Nothing is inferred.

A Math node then runs the checks: line items against subtotal, tax against rate, and subtotal plus tax against the total. Those checks sit in a calculation node so the model does not verify its own reading.

A Validate node applies format rules: date format, currency code, and required fields. An If node then acts on the combined result.

Clean invoices go to a PostgreSQL or Google Sheets node as posted rows. Invoices that fail a check go to a Slack node in the Human in the Loop category, with the failing line named, so the reviewer looks at one number rather than the whole document.

A Google Sheets node logs each extraction and the check result. That log is how you learn that one supplier's format breaks the process every month.

Nodes this ActionFlow uses

  • Email (Communication): reads the accounts inbox. Document Upload (Data) takes direct submissions.
  • PDF4me (Data): extracts the document contents.
  • Extract Data (Data): narrows long documents to the pages carrying line items.
  • Generate Object (AI Core): returns supplier, number, date, currency, line items, and totals as a structure.
  • Math (Util): checks line items against subtotal, tax against rate, and the stated total.
  • Validate (Data): applies format rules and required fields.
  • Slack (Human in the Loop): routes failing invoices with the specific failing line named.
  • PostgreSQL (Data): receives clean rows. Google Sheets and MySQL fit the same slot.

Frequently asked questions

Start building AI workflows

Create a free account, open a template or a blank canvas, and run your first ActionFlow.

Newsletter

Get product updates

New nodes, agents, and product notes. We send mail only when we have something worth opening.

Unsubscribe at any time.