Invoice Processing Automation Workflow: Inbox to Approved in the ERP
Invoice processing automation takes the supplier invoice from wherever it arrives — email attachment, portal, scan — extracts every field, validates it against the PO and the receipt, routes it to the right approver with the exceptions highlighted, and posts it to the ERP coded and ready to pay. Accounts payable handles exceptions instead of keying.
Written by Max Zeshut
Founder at Agentmelt · Last updated Sep 11, 2026
The problem
AP staff key invoices by hand, chase approvers by email, and discover duplicates and mismatches at month end. Suppliers call about payment status. Early-payment discounts are missed because approval took three weeks.
What changes when it runs
Invoices are in the ERP the day they arrive, three-way matched where a PO exists, coded from history where it does not, and approved on the phone. Duplicates are caught before posting. Cycle time drops from weeks to days, and the AP team's work becomes exceptions and supplier relationships.
Trigger, then 8 steps
Trigger
Gmail / Outlook trigger on the AP inbox + portal polling
New attachments to ap@ start the run; supplier portals and scanned batches are polled hourly.
Capture the invoice
Gmail TriggerPDF, image or e-invoice attachment saved to a document store with the email metadata; non-invoice attachments are classified and filed elsewhere.
Extract fields
Information ExtractorSupplier, invoice number, dates, line items, quantities, unit prices, tax, totals, PO reference and bank details, with a confidence per field. Multi-page and multi-currency handled.
Validate and detect duplicates
CodeTotals foot, tax is arithmetically right, supplier exists (or is flagged as new), bank details match the master (change = fraud alert), and no invoice with the same supplier + number + amount exists.
Match to PO and receipt
HTTP RequestThree-way match against the ERP: PO lines, quantities received, prices within tolerance. Non-PO invoices are coded by the agent from supplier history and GL rules.
Route exceptions and approvals
SwitchClean matches auto-approve within policy limits; mismatches go to the buyer with the specific difference; non-PO invoices go to the cost-centre owner; new suppliers go to procurement for onboarding.
Approve on the phone
SlackApprovers get the invoice summary and the exception in Slack or email with approve/reject/query buttons; reminders escalate after the SLA.
Post to the ERP
HTTP RequestApproved invoices are created in NetSuite, Xero, QuickBooks, Sage or SAP with coding, attachments and the approval trail; payment runs pick them up.
Supplier status replies
AI AgentSupplier emails asking about payment status are answered from the ERP data (received, approved, scheduled for date) so AP stops fielding calls.
Data it touches
- AP inbox and supplier portals
- ERP: POs, receipts, supplier master, GL, approval policy
- Historic coding for non-PO invoices
- Bank-detail master for fraud checks
Guardrails
- Bank-detail changes never post automatically; they trigger a verification call with the supplier.
- Auto-approval applies only to PO-matched invoices within tolerance and policy limits; everything else has a named approver.
- Duplicates are blocked before posting, not caught at month end.
- Low-confidence extractions are reviewed by a person before matching.
Extraction is solved; matching and routing are the work
Reading fields off an invoice is a solved problem — modern models extract line items from messy PDFs with high accuracy and tell you where they are unsure. The value is in what happens next: matching to the PO and receipt, deciding who has to look at a mismatch and what exactly they are looking at, and coding the non-PO invoices consistently. The workflow spends most of its logic there, and that is where AP time was going.
Fraud controls that a workflow enforces better than people
Invoice fraud usually arrives as a changed bank account on a real supplier's invoice, or a duplicate with a slightly different number. Both are exactly the checks a workflow never forgets: every invoice's bank details are compared to the master, and any change stops the process for a verification call; every invoice is checked for duplicates across supplier, number and amount before posting. Those two rules alone justify the automation for many finance teams.
What to measure
Cycle time from receipt to posting (target: under three days for PO invoices). Touchless rate — invoices posted with no human action — which climbs as coding rules and tolerances are tuned, typically past 60% for PO-heavy businesses. Duplicate and mismatch catches. Early-payment discounts captured, which are pure money the old process was leaving on the table.
Tools in the stack
| Tool | Role in this workflow |
|---|---|
| n8n | Capture, validation, routing, posting |
| Claude | Field extraction, non-PO coding, supplier replies |
| NetSuite / Xero / QuickBooks / Sage | ERP of record |
| Slack / email | Approvals |
| Google Drive / S3 | Invoice documents |
Want this running without building it?
Automation workflow
$297/month
We set up, host and maintain this workflow on n8n and connect it to your tools. Setup included, cancel monthly, you keep the JSON.
Custom build
$5,000–9,000 one-time
Your systems, your rules, your edge cases. A one-off build on Claude and n8n, delivered with documentation and a walkthrough.
Covers up to 1,000 invoices a month, one ERP and one AP inbox. Multi-entity, multi-currency approval matrices, or ERPs without an API are a custom build.
Frequently asked questions
Which ERPs are supported?
NetSuite, Xero, QuickBooks Online, Sage Intacct, Microsoft Dynamics and SAP Business One via API. ERPs without an API get a validated import file and a manual posting step.
How accurate is the extraction?
Field-level accuracy on typical supplier invoices is high, and every field carries a confidence score; anything below threshold is reviewed by a person before it can be matched or posted. Accuracy improves as supplier-specific layouts are learned.
Does it pay invoices?
No. It posts approved invoices to the ERP; your existing payment run and controls are unchanged.
Calculator
Put your own numbers in
Estimate the cost of the current process and what this workflow changes.
The pillar
AI Accounting Agent
Automate bookkeeping, invoicing, expense categorization, and bank reconciliation with AI.