INVOICE PROCESSING

Extract Emailed Invoice PDFs and Compare Them to the Vendor Baseline

When a vendor invoice PDF lands in the finance inbox, extracts the amount and line items, compares the total to that vendor's historical baseline.

CategoryInvoice Processing
Enginesim
Difficultyintermediate
Triggerevent
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerNew invoice email in finance inboxGmailGmail
  • ActionExtract vendor, total, line items from PDFOpenAI
  • ActionLookup baseline and upsert invoicePostgreSQLPostgres
  • LogicTotal deviates from baseline tolerance?
  • OutputCreate Notion review-board card for deviationNotionNotion

What it does

Handles recurring invoices that arrive as emailed PDFs rather than through an API. When a new invoice email hits the finance inbox, it parses the attachment, extracts the vendor, total, and key line items, then checks the total against that vendor's stored baseline. Normal invoices are archived; deviating ones are pushed to a Notion review board with the parsed details.

When to use it

Use it when a chunk of your recurring spend comes from vendors who only email PDF invoices. It removes manual data entry and still applies anomaly detection, so off-baseline charges surface for review instead of being paid on autopilot.

How it works

  1. 1A new email with an invoice attachment arrives in the finance inbox.
  2. 2An action runs OCR and structured extraction on the PDF to pull vendor, total, and line items.
  3. 3A Postgres lookup fetches the vendor's historical baseline and upserts this invoice.
  4. 4A logic step compares the total to the baseline tolerance.
  5. 5On-baseline invoices are marked processed and the run ends.
  6. 6Deviating invoices create a Notion review-board card with the extracted fields, variance, and a link to the source email.

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 NotionPages, databases, comments.
  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.