{"product_id":"n8n-invoice-duplicate-po-mismatch-checker-gmail-sheets-openai","title":"n8n Invoice Duplicate \u0026 PO Mismatch Checker (Gmail, Sheets, OpenAI)","description":"\u003ch3\u003eAutomatically detect duplicate invoices and PO mismatches from Gmail PDFs—then route exceptions for approval\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow monitors your Gmail for PDF invoices, extracts invoice fields with OpenAI, and cross-checks them against your Google Sheets registers to catch duplicates, bank-detail changes, and PO\/receiving mismatches. High-risk invoices get put on hold; clean invoices are auto-cleared; unreadable PDFs are flagged for manual keying.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRuns every 5 minutes\u003c\/strong\u003e when a new Gmail message arrives that includes a \u003cstrong\u003ePDF attachment\u003c\/strong\u003e, loading configuration values such as \u003cstrong\u003eGoogle Sheet ID\u003c\/strong\u003e, approver emails, and thresholds.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReuses Google Sheets registers\u003c\/strong\u003e by reading the \u003cstrong\u003eSuppliers\u003c\/strong\u003e, \u003cstrong\u003ePurchase orders\u003c\/strong\u003e, and \u003cstrong\u003eLedger\u003c\/strong\u003e tabs once for the whole batch of emails.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eProcesses each invoice independently\u003c\/strong\u003e by splitting emails into one item per PDF attachment.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eExtracts structured invoice data with OpenAI\u003c\/strong\u003e (gpt-4o-mini), including supplier, invoice number, dates, totals, PO number, and \u003cstrong\u003eIBAN\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eValidates invoice consistency\u003c\/strong\u003e by parsing dates, checking totals arithmetic, implying VAT rate, and performing an \u003cstrong\u003eIBAN checksum\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eChecks against registers\u003c\/strong\u003e for prior payment\/duplicates, supplier bank-detail changes, and \u003cstrong\u003ePO\/received-amount mismatches\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRoutes the result\u003c\/strong\u003e via email: holds blocked invoices for finance, sends a Gmail approval request and \u003cstrong\u003ewaits up to 3 days\u003c\/strong\u003e for higher-risk\/higher-value invoices, auto-clears small clean invoices, and flags unreadable invoices for manual keying—then updates\/appends the \u003cstrong\u003eLedge\u003c\/strong\u003e in Google Sheets.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eCatch duplicate invoice submissions before they hit payment.\u003c\/li\u003e\n  \u003cli\u003eDetect changes in IBAN\/bank details versus your supplier master.\u003c\/li\u003e\n  \u003cli\u003eConfirm PO reference and received amounts match expected purchase orders.\u003c\/li\u003e\n  \u003cli\u003eKeep finance reviews focused by routing exceptions and clearing low-risk invoices automatically.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIntegrations\/nodes:\u003c\/strong\u003e Gmail, Google Sheets, OpenAI (gpt-4o-mini), plus workflow logic nodes such as if, set, code, switch, and no op.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCore flow:\u003c\/strong\u003e Gmail trigger → PDF text extraction → OpenAI structured extraction → validation (totals\/VAT\/IBAN) → cross-check registers in Sheets → email routing (hold\/approval\/auto-clear) → update Sheets Ledger.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46042471334067,"sku":"N8N-19634","price":49.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/kh59JbJ2GLny-RpfqDtXd_Bl50itE6.png?v=1789549648","url":"https:\/\/buyflowscripts.com\/products\/n8n-invoice-duplicate-po-mismatch-checker-gmail-sheets-openai","provider":"N8N Commerce","version":"1.0","type":"link"}