I built and tested an 8-node n8n workflow for reconciling invoice exports against purchase orders.
What it does: Manual Trigger → synthetic input (5 POs, 9 invoice rows) → JavaScript Code node checks invoice references, unit prices, quantities, vendors, currencies, duplicates and totals → IF splits REVIEW and MATCHED → manual-review vs matched branches → Merge → CSV and HTML report content.
Test: Executed successfully in n8n 2.42.5 with Node.js 24.21.0 on 8 October 2026. The synthetic fixture produced 2 matched and 7 review-required invoice records. A separate Node.js validation test also passed.
Important scope: This is an independent portfolio demo, not prior paid client work. It uses only fabricated data and does not parse uploaded PDFs, connect to banks or ERP systems, email anyone or approve payments. Any real integration would need client-approved inputs, authentication, error handling and acceptance tests.
I’d appreciate feedback on exception-routing design and how best to package this as an importable template for a small paid pilot. I have a sanitized workflow JSON and illustrated CSV/HTML test report available to share in accordance with community guidelines.
For the exception-routing part, I’d keep a reason code alongside REVIEW rather than treating every unmatched invoice the same. A duplicate invoice, missing PO and price mismatch need different follow-up actions, even if they all go through manual review
For a small paid pilot, I’d make those reason codes, tolerances and expected reviewer actions part of the acceptance tests. That gives the client something concrete to validate before connecting real accounting data
Thanks, Mahdi. I implemented your suggestion in an updated, separate demo: explicit reason codes, a USD 0.50 tolerance, and a reviewer action for each exception. Both copies of a duplicate invoice are held, and missing or ambiguous POs are kept separate from amount and currency issues.
The updated invoice fixture contains 10 invoices: 3 matched and 7 for review. All 11 acceptance checks passed in n8n 2.42.5.
I also completed two related portfolio demos:
- CSV consolidation: two source files, 8 rows, 2 ready records totaling USD 145.50. Exact repeats, conflicting duplicates, invalid dates and invalid amounts are accounted for. All 9 checks passed.
- Lead intake review: 8 test events routed into ready, clarification, invalid, urgent, out-of-scope and duplicate groups. All 9 checks passed; no messages were sent and human approval remains required.
All three workflows were executed on 11 October 2026. Four additional checks verified the exported CSV row counts and formula-like text escaping.
Attached are a three-page portfolio PDF and the three individual importable workflow JSON files. Each workflow starts manually, creates its own synthetic CSV input and returns a downloadable report in the final “Verified demo output” node. No credentials are required for these demos.
These are independent, AI-assisted demonstrations using synthetic data, not previous client deliveries. They do not include live ERP/CRM connections, invoice OCR, payment approval or persistent replay storage. A client pilot would need agreed input fields, business rules and acceptance criteria before any real system is connected.
Lenur
(attachments)
Lenur_n8n_Portfolio.pdf (50.8 KB)
01_Invoice_PO_workflow.json (9.81 KB)
02_CSV_Consolidation_workflow.json (9.51 KB)
03_Lead_Intake_workflow.json (9.22 KB)
1 Like
Nice iteration. Turning @Mahdi_Eqbal reason-code suggestion into acceptance checks is exactly what makes a pilot easy to say yes to.
One thing I’d think about before a real client: the matching is the quick part. What comes after REVIEW is a long-running job, because an exception can sit with a person for days, and that’s where pilots usually get stuck. The first question a finance team asks is “what happened to invoice 1042 after it was flagged?”
So I’d treat each exception as a record with its own status, not just a row in the report:
Flagged (reason) → Under Review → Approved / Rejected
with Waiting on Vendor and Escalated on the side.
That shape answers a few things the demo leaves open:
- The reviewer action becomes a recorded step, with who decided and when, which is what an auditor will want to see.
- Duplicates resolve cleanly. You already hold both copies. When the reviewer rejects one, the other moves on automatically instead of waiting for a second decision.
- Re-runs don’t re-flag settled items. Tomorrow’s import checks the status first, so a duplicate that’s already been rejected stays rejected. That covers the “no persistent replay storage” gap you mentioned.
- Ageing is visible. Anything in
Under Review or Waiting on Vendor for more than a few days gets escalated instead of quietly forgotten.
Your n8n workflow would still do all the matching and routing. It just hands exceptions over to a status that outlives the run. Might be worth showing in the pilot pack.
When a vendor sends a corrected invoice, would it replace the flagged one, or come in as a new invoice that needs linking back?
Thanks for the detailed feedback. A persistent exception record and decision history would be a useful next step.
For a paid pilot, I would keep the original flagged invoice and store a corrected submission as a linked version, with its own validation result. The history would show what changed, who reviewed it and when. The corrected version would go through the relevant checks again before approval, with safeguards against processing both versions. The exact correction and duplicate rules would be agreed with the finance team.
This is a proposed extension: the current demo does not yet implement persistent exception tracking or corrected-invoice versioning.
If you have a real use case, either in your team or for a client, I would be interested in discussing a small, scoped paid pilot or delivery collaboration. Could you share:
- Whether this is your own workflow or a client project, and the help you need;
- The current accounting system, input formats and approximate invoice volume;
- The main exception types and who reviews them;
- Your target deadline and budget range?
We can discuss confidential details and anonymised examples privately. Once the scope is clear, I can assess feasibility and propose a fixed-price milestone with concrete acceptance tests and agreed payment terms before development starts.
Best regards,
Lenur
One test I’d add to the invoice pilot is partial invoicing against the same PO line.
Suppose the PO is for 10 units at $50 each. Two different invoices arrive for 6 units each, both with the correct price, vendor and currency. Each is below the PO quantity, but together they bill 12 units. If the checks run per invoice, that can slip through even when both totals are correct.
I’d check cumulative billed quantity at PO-line level, including earlier invoices and the current batch. For two-way matching, check the ordered quantity; for three-way matching, also check the applicable received quantity. The $0.50 amount tolerance should stay separate from whatever quantity tolerance the finance team agrees.
For the CSV-based pilot, I’d use an agreed snapshot of the company’s ERP/AP ledger as the source of net posted quantities, including credits and reversals. Keep pending invoices and the current batch visible separately, so the finance team can decide which states reserve quantity. If that history is missing, this control stays REVIEW / HISTORY_MISSING.
For re-imports, agree a stable line identity company + supplier ID + invoice number + invoice-line ID and persist it with the PO-line link and source status. A repeat updates the existing record rather than adding its quantity again; a changed status triggers a recheck. Keep revisions linked separately. A replacement PDF must not erase a posted invoice: any credit or reversal still comes from the accounting ledger.
A small fixture could start with 10 ordered units, all 10 received, none previously billed, and zero quantity tolerance. Then test:
- Two distinct invoices for 6 + 4: quantity control passes at exactly 10.
- Two distinct invoices for 6 + 6: overbilling goes to review.
- Import the same 6-unit invoice again: cumulative billed quantity stays at 6.
Those results test this quantity control, not whether every other check passes or an invoice is approved for payment.
Do your inputs include that PO-line history, or only the invoices in the current import?
Good catch. The current demo only includes the synthetic PO rows and
invoices in the current run; it does not load persisted PO-line
invoice history from an ERP/AP ledger. So it cannot safely detect
cumulative overbilling across separate runs yet, and I would not
present it as a complete two-way or three-way control.
For a real paid pilot, I would make the history source an explicit
input: an agreed snapshot of posted quantities, credits and reversals,
plus the pending/current batch kept separately. If that history is
unavailable, the workflow should return REVIEW / HISTORY_MISSING
rather than a match.
I would also persist a stable invoice-line identity with the PO-line
link so that a re-import updates the existing record instead of adding
quantity again. The first regression fixture would be exactly the
cases you suggested: 6 + 4 passes at 10, 6 + 6 goes to review, and
re-importing the same 6-unit line leaves the cumulative quantity at 6.
Thanks — this exposes an important boundary in the current portfolio demo.
Thanks, Andrew. The published demo checks the current invoice batch against PO data; it does not yet import historical ERP/AP quantities.
Your 6+4, 6+6 and repeated-import examples are useful acceptance cases for a cumulative PO-line control. I would agree the ledger snapshot and quantity-reserving statuses with the finance team, keep quantity tolerance separate from the amount tolerance, and route missing history to REVIEW / HISTORY_MISSING. Posted invoices and accounting credits or reversals would retain their history.
Is this a control you need for an existing workflow or a client project? If so, which ERP and input files are involved, what needs to be delivered, and what deadline and budget are you working with? An anonymised sample and expected output would help define a small, testable pilot.
Best regards,
Lenur
Thanks, Lenur. This was feedback on the demo, rather than a client project brief from me, so I don’t have an ERP, deadline or budget to give you.
When you add the history source, I’d run the quantity tests across separate executions as well: import 6 units, restart, then import another 6 against the same 10-unit PO line. That should go to review. Re-importing the first invoice after a restart should still leave its contribution at 6. Those two results would make the persistence behaviour easy for someone evaluating the demo to check.
Hi Andrew,
Thank you for clarifying, and for the helpful technical feedback. Testing across separate executions is exactly the right way to verify persistent state and avoid counting a re-imported invoice twice.
I’ll add the two restart scenarios to the acceptance-test plan: a second distinct 6-unit invoice against a 10-unit PO line must go to review, while re-importing the original invoice must leave its billed contribution unchanged at 6 units.
The current published demo does not yet implement persistent invoice history, so I will keep that limitation explicit until the extension is built and those tests pass.
I appreciate you taking the time to review it.
Best regards,
Lenur Bekirov