Knowledge Base

Build Invoice → PO Matching Workflow

Duration: ~20 min · Level: Intermediate · Template: #263 Invoice → PO Matching · Deployment: On-prem (IMAP + local OCR/PDF)

Prerequisites: IMAP mailbox for supplier invoices; SQLite (or synced) purchase_orders table with columns po_number, amount, vendor; SMTP for mismatch alerts. Desktop Studio on a machine that can reach the mailbox and DB file.

Automate the classic AP chore: when an invoice lands in email, extract fields, match it to a purchase order, and email AP only when the PO is missing or the amounts do not line up.

What this template does

  1. New Invoice Email — IMAP poll; saves PDF/image attachments.
  2. PDF or Image? — PDF → pdf.extractText; image → Vision OCR.
  3. Read Invoice + PO # — field extractor for supplier, invoice number, PO number, total.
  4. Lookup PO in Accounting — SQLite join against purchase_orders; status matched / missing_po / amount_mismatch.
  5. Branch — log OK, or email AP on mismatch.

Step 1 — Seed purchase orders

  1. Create the table once:
    CREATE TABLE purchase_orders(
      po_number TEXT PRIMARY KEY,
      amount REAL,
      vendor TEXT
    );
  2. Insert a few real POs (or sync from your ERP into this file).

Step 2 — Load template #263

  1. Open Studio → Templates (or empty-canvas recipe When an invoice hits email…).
  2. Search PO Matching and load template #263.

Step 3 — IMAP, DB path, alert To

  1. Set IMAP host/credentials and attachment folder on New Invoice Email.
  2. Point Lookup PO in Accounting at your purchase_orders.db path.
  3. Set SMTP and the AP clerk address on both mismatch email nodes.

Step 4 — Dry-Run, then Activate

  1. Send a test invoice PDF with a known PO number to the mailbox.
  2. Use 🧪 Dry-Run first, then Activate. Watch Jobs → Schedule for the email trigger.

Related

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.