Built an n8n Workflow to Automatically Verify Supplier Confirmations Against ERP Purchase Orders

Hi everyone! :waving_hand:

I recently built a Procurement PO Checker MVP using n8n, ERPNext API, Excel, and Slack.

The problem

When a supplier confirmation contains dozens of line items, manually comparing every SKU, quantity, price, and delivery date against the original Purchase Order becomes time-consuming.

It gets even more complicated when suppliers confirm quantities in packs or boxes instead of individual units.

What the workflow does

  1. A supplier confirmation (Excel) is uploaded to Slack.

  2. n8n validates the file and retrieves the corresponding Purchase Order through the ERPNext API.

  3. Each line is compared against the ERP data:

    • Supplier SKU and PO line matching

    • Confirmed quantities, including packaging conversions

    • Unit prices

    • Requested vs. confirmed delivery dates

    • Missing or invalid information

  4. The workflow posts the verification result directly in the original Slack thread.

Example: 100 units ordered, but only 80 confirmed → a 20-unit shortage is detected and reported.

If all values match, the workflow returns ALL CHECKS PASSED.

I also implemented error handling for invalid Excel files, missing Purchase Orders, and ERPNext API failures.

The comparison logic is rule-based, using n8n Code nodes rather than an AI agent.

This is an MVP built to demonstrate automated procurement verification, not a production deployment.

I’ve attached a short demo and a screenshot of the workflow.

I’d be interested to hear how others approach supplier confirmation validation and unit conversions in n8n.

Tech stack: n8n · ERPNext API · Slack · Excel · JavaScript

A rule-based comparison is a sensible choice here, because the result needs to be deterministic and auditable. For the pack versus unit conversions, one approach is to keep a small mapping of SKU to units per pack in the ERP or a lookup sheet and convert before comparing, rather than inferring it from the confirmation text, and to flag any SKU with no mapping instead of guessing. It can also help to compare prices and quantities within a small tolerance, for example rounding to the currency’s decimal places, so minor floating-point differences do not trigger false mismatches, and to log each check result with the PO number so exceptions can be reviewed later.

1 curtida

How do you handle the same SKU appearing on two PO lines with different delivery dates? For example, 50 units due this week and 50 next month, but the supplier confirms one line of 100. The total quantity matches, yet the delivery commitment may not. Does your matching use the ERP PO line ID when available, and flag ambiguous matches rather than combining them by SKU?

1 curtida

Thanks for the suggestions! I agree, especially about using a SKU-to-pack mapping for a production version.

Right now, the workflow uses the structured Packaging field in the supplier’s Excel file to convert quantities and checks for inconsistencies.

Adding a mapping in ERPNext, price rounding, and logging would definitely make the workflow more reliable in production.

Thanks for sharing your ideas!

Good point! In the current MVP, matching is based on Supplier SKU rather than PO Line ID.

If the same SKU appears on multiple PO lines, the workflow flags it as an ambiguous match instead of combining the quantities or assuming which delivery date applies.

So in your example, the 100-unit confirmation wouldn’t automatically pass the check.

Using PO Line ID for more precise matching would be a good improvement for a production version. Thanks for pointing this out!

1 curtida

Nice work, Yana! I like that you’ve kept the comparison logic rule-based instead of adding an AI agent where deterministic validation is more appropriate.

One additional case worth testing is how the workflow handles duplicate supplier uploads or a retry after an ERPNext API timeout, so the same confirmation doesn’t create duplicate processing or inconsistent results.

I’ve been working on n8n workflows with FastAPI and PostgreSQL, focusing on idempotency, validation, and failure recovery. This is a very relevant use case!

1 curtida

Thanks for your feedback!

The goal of this MVP is to compare each uploaded supplier confirmation against the current PO data in ERPNext.

Rechecking the same file is fine in this case, since the workflow only reads and compares data. It doesn’t create or update any ERPNext records.

I’ve attached a screenshot showing how the verification results are reported in Slack.

I agree that idempotency becomes more important when a workflow performs actions that shouldn’t be repeated.

That makes sense, thanks for clarifying! Since the current workflow is read-only, rechecking the same file is perfectly reasonable. Idempotency becomes more critical once the workflow starts creating records or triggering external actions. I like the clear separation between deterministic PO validation and actions that may need duplicate protection. Nice MVP!

1 curtida