INVOICE PROCESSING

OCR vendor invoices and 3-way match against POs before approval

Reads emailed PDF invoices, extracts line items with OCR, matches each line against the purchase order and goods receipt in Postgres.

CategoryInvoice Processing
Enginesim
Difficultyintermediate
Triggerevent
Steps6
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerNew invoice email in AP inboxGmailGmail
  • ActionOCR extract header and line items from PDFOpenAI
  • ActionFetch matching PO and goods receiptPostgreSQLPostgres
  • Logic3-way match quantity and price within tolerance
  • ActionWrite approved status back to ledgerPostgreSQLPostgres
  • OutputPost discrepancies to AP channelSlack

What it does

Watches a shared AP inbox for vendor invoices, extracts the vendor, PO number, and every line item from the PDF, then performs a classic 3-way match: invoice line vs. purchase order vs. recorded goods receipt. Quantities and unit prices that agree within tolerance auto-approve; anything off-tolerance is held and posted to the AP channel for a human.

When to use it

Use this when your team manually keys invoices and eyeballs them against POs. It removes the data entry and the line-by-line comparison while keeping a person in the loop only for real exceptions.

How it works

  1. 1A new invoice email lands in the AP inbox and triggers the run.
  2. 2OCR extracts header fields and line items from the attached PDF.
  3. 3The flow looks up the referenced PO and its goods-receipt records in Postgres.
  4. 4A match check compares quantity and price per line within a tolerance band.
  5. 5Clean invoices are written back as approved; mismatches are flagged.
  6. 6Flagged invoices post to the AP Slack channel with the specific deltas for review.

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
    Connect SlackChannels, DMs, threads, mentions.
  5. 5
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  6. 6
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  7. 7
    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.