Business

Invoice → PO Matching: Automate the AP Chore Without Custom OCR Code

Accounts payable still spends hours on the same loop: open the supplier email, open the PDF, find the PO number, look it up in accounting, and chase mismatches by hand. Template #263 Invoice → PO Matching turns that into a visual workflow you load in Studio — IMAP in, OCR/PDF extract, database lookup, email only when something does not line up.

This guide walks through what the template does, how to seed purchase orders, and how to go live on-prem without writing custom OCR scripts.

Who this is for

  • AP clerks and office managers who receive supplier invoices by email
  • Teams that already keep purchase orders in SQLite, a synced ERP extract, or a local accounting DB
  • Anyone who wants mismatch alerts without a full AP suite

What template #263 automates

  1. IMAP poll — unread messages; PDF/PNG/JPEG attachments saved to a local folder
  2. PDF vs image — pdf.extractText or Vision OCR
  3. Field extract — supplier, invoice number, PO number, total, currency
  4. PO lookup — join against purchase_orders; classify matched, missing_po, or amount_mismatch
  5. Notify — quiet log on match; SMTP email to AP on mismatch

The template is marked OnPremOnly because IMAP attachments and local OCR stay on your machine — credentials never leave your LAN unless you choose a cloud connector.

One-time setup

  1. Create the PO table:
    CREATE TABLE purchase_orders(
      po_number TEXT PRIMARY KEY,
      amount REAL,
      vendor TEXT
    );
  2. In Studio, open Templates (or the home recipe When an invoice hits email…) and load #263.
  3. Set IMAP credentials, the DB path, and the AP clerk SMTP To address.
  4. Dry-Run, then Activate and watch Jobs → Schedule.

Why not only “invoice OCR”?

Inbox → OCR → SQLite is useful (#227 / #233 / #44), but AP value is matching. Template #263 closes the loop against purchase orders and only interrupts a person when the PO is missing or the amounts disagree — the Reddit-style chore teams actually complain about.

Next steps

Nodlyn Assistant
Ask me anything about Nodlyn
Hi! 👋 I'm the Nodlyn assistant. Ask me about the product, workflow components, connectors, agent runtime, agent capabilities, deployment, and more. If I don't know an answer, I'll point you to our contact form.
Nodlyn Assistant
Ask me anything about Nodlyn
Hi! 👋 I'm the Nodlyn assistant. Ask me about the product, workflow components, connectors, agent runtime, agent capabilities, deployment, and more. If I don't know an answer, I'll point you to our contact form.