n8n is the workflow orchestration layer that connects invoice receipt (Gmail or email inbox monitoring), ERP data (NetSuite, SAP, or Google Sheets if a smaller operation), AI matching (Claude or OpenAI), approval routing (Slack notifications or email), and payment queue updates into a single automated AP workflow. The workflow runs without code changes for routine invoice processing and escalates to human attention for exceptions.
The Workflow Components
Step 1: Gmail trigger fires when a new invoice email arrives in the AP inbox. Step 2: The AI model reads the invoice attachment, extracts the vendor ID, PO number, line items, and total. Step 3: n8n queries the ERP for the matching PO and goods receipt. Step 4: The AI performs the 3-way match comparison. Step 5: Clean invoices are written to the payment approval queue. Discrepant invoices are routed to the configured approver via Slack with all three documents attached. Step 6: All match results are logged to the audit trail.
The Accounts Payable 3-Way Match AI Agent is built on exactly this n8n architecture — and the demo shows the full workflow in action.