Most accounts payable automation content assumes you are shopping for dedicated AP software. That is how SAP, NetSuite, and J.P. Morgan write about it, because that is what they sell.
If you are a mid-market manufacturer who already has an ERP and wants to automate AP without adding another platform, replacing another vendor contract, or running a six-month implementation, this post is for you.
The approach: use n8n to sit alongside your existing ERP, read and write data via the API, and automate the core AP workflows without touching your ERP configuration.
Before looking at the automation, it is worth being specific about what manual AP actually costs.
A typical mid-market manufacturer with 100 to 500 invoices per month spends significant staff time on AP:
Conservative estimate: 4 to 8 hours per week per AP clerk, at a fully loaded cost of $35 to $45 per hour, comes to $7,280 to $18,720 per year in labor. That does not include the cost of errors, late payment penalties, or duplicate payments from missed matches.
The 3-way match (purchase order, goods receipt, invoice) is the highest-leverage point to automate. It is repetitive, rules-based, and the source of most errors when done manually.
The obvious solution is to buy AP automation software. The reason most mid-market manufacturers do not:
The alternative is to automate AP workflows using your existing ERP's API and a workflow tool like n8n, without adding a new platform to your stack.
The approach uses three components:
1. n8n: the workflow engine. Runs as a self-hosted instance (or n8n cloud if your data sensitivity allows it). Handles all the trigger and logic layers.
2. Your ERP's REST API: the data source. NetSuite, SAP Business One, Epicor, and JobBOSS2 all have documented REST APIs. n8n reads PO data and goods receipt records from the ERP via API call.
3. Email or vendor portal: the invoice ingestion point. Most manufacturers receive invoices by email. n8n connects to a monitored inbox, parses incoming invoices (via structured attachment or AI extraction), and initiates the match process.
Nothing is added to your ERP configuration. n8n reads from it and writes back on confirmed events only.
This is the core AP automation for manufacturers. Here is how it runs in n8n:
Trigger: Invoice received
An invoice arrives in a monitored email inbox (e.g., ap@yourcompany.com). n8n watches the inbox via Gmail or Microsoft 365 connector. On new message with attachment, the workflow fires.
Step 1: Extract invoice data
n8n passes the PDF attachment to a document parsing step. For structured invoices with consistent layouts, this can be a regex extraction. For varied formats, an AI extraction node (Claude or a document parsing API) pulls vendor name, invoice number, line items, and total.
The extracted data is stored as a structured object in n8n for the rest of the workflow.
Step 2: Look up the matching PO
n8n calls your ERP's REST API with the vendor name and PO number from the invoice. It retrieves the open PO record: what was ordered, from whom, at what price, and whether a goods receipt has been posted.
If no matching PO is found, the workflow routes immediately to the exception path (Step 5).
Step 3: Check the goods receipt
n8n makes a second API call to check whether a goods receipt exists for the PO line items on this invoice. This is the "receipt" leg of the 3-way match.
Three outcomes:
Step 4: Auto-match and queue for payment
If the invoice matches the PO and goods receipt within tolerance (typically within 1-2% for rounding), n8n writes the invoice back to the ERP via API as a matched and approved payable, queued for the next payment run.
A confirmation notification goes to the AP team via Slack or email: "Invoice #12345 from [Vendor] matched and approved. $14,200. Due [date]."
The AP clerk reviews the queue and runs payment. The manual matching step is gone.
Step 5: Exception routing
Exceptions route to a Retool-based AP exception dashboard (or a simple email alert if Retool is not in your stack). The dashboard shows:
The AP clerk resolves the exception in the dashboard. Approved exceptions trigger the same write-back to ERP as Step 4.
Being specific about scope matters here.
This automation handles:
This does not handle:
Starting with standard matched invoices covers the majority of AP volume for most manufacturers. Non-PO invoices can be added in a second phase once the core workflow is stable.
The workflows described above work with ERPs that have documented REST APIs. Confirmed compatible:
If your ERP uses SOAP/XML web services instead of REST (common in older versions), the n8n workflow requires a slightly different configuration but the same logic applies.
If your ERP has no API at all, this approach requires a different ingestion strategy (database read, scheduled export, or an ETL layer). That is a more complex project and a reason to evaluate whether the ERP is a constraint worth addressing.
This is not a no-code, afternoon project. It is an engineering task that requires:
For a manufacturer without an internal automation developer, this is a project for an automation engineer with ERP integration experience. The build is not complex, but the ERP API setup and edge case handling require someone who has done it before.
The payoff: once it is in production and stable, the workflow runs without ongoing intervention. The AP team shifts from manual matching to exception review. That is where the time recovery happens.
AP automation is typically workflow two or three in a manufacturing automation program, not workflow one. The reason: it requires ERP API access that, once established, opens up a much larger set of workflows.
The same NetSuite API credentials that power AP matching also power:
Every ERP integration built for AP becomes reusable infrastructure for the next ten workflows. That is the compounding effect of treating automation as a program rather than a series of one-off projects.
Want the framework for identifying which workflows to automate first and in what order? The Flow Kaizen guide covers exactly that, including a scoring matrix for automation readiness and a prioritization method based on operating margin impact.