INVOICE PROCESSING

Emailed Invoice Auto-Approve Within Match Tolerance

Parses invoices arriving in a Gmail inbox, runs a three-way match against PO and receipt data.

CategoryInvoice Processing
Enginesim
Difficultyintermediate
Triggerevent
Steps6
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerInvoice email received in labelGmailGmail
  • ActionExtract line items from PDFOpenAI
  • ActionLook up PO + receipt in PostgresPostgreSQLPostgres
  • LogicCheck lines against tolerance bands
  • ActionAuto-approve and mark in PostgresPostgreSQLPostgres
  • OutputForward exceptions to AP reviewerGmailGmail

What it does

Most matched invoices differ from the PO by a few cents or a rounding unit. This workflow reads invoices straight from email, matches them against the PO and receiving record, and clears everything that falls inside your defined price and quantity tolerance automatically. Only out-of-tolerance invoices reach a human.

When to use it

Use it when vendors email PDF invoices and your AP team is rubber-stamping near-perfect matches by hand. It cuts the manual queue down to the genuine exceptions.

How it works

  1. 1A new invoice email lands in the monitored Gmail label and triggers the run.
  2. 2An OpenAI extraction step reads PO number, line items, quantities, and amounts from the attachment.
  3. 3The workflow looks up the PO and goods-receipt rows in Postgres.
  4. 4Logic checks each line against the configured price and quantity tolerance bands.
  5. 5Within tolerance: the invoice is marked approved in Postgres and a confirmation reply is sent.
  6. 6Out of tolerance: the variance is forwarded to the AP reviewer via Gmail with the mismatched lines highlighted.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GmailRead, draft, send, label.
  2. 2
    Connect OpenAIModels, embeddings, files.
  3. 3
    Connect PostgresAny Postgres URL — query, write, migrate.
  4. 4
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  5. 5
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  6. 6
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.