Quick Overview
This workflow collects an invoice PDF via an n8n form, archives and extracts it in PaperOffice AI, cross-checks it against historical documents for IBAN changes, duplicates, and order/delivery mismatches, and then queues it for human review before tagging the document based on a signed PaperOffice webhook decision.
How it works
- Receives an invoice PDF upload via an n8n form and validates required settings like the PaperOffice workspace ID and HITL agent UUID.
- Uploads the PDF to PaperOffice AI, then runs PaperOffice AI invoice extraction to read key fields such as supplier, invoice number, total, IBAN, and line items.
- Searches the PaperOffice AI workspace for earlier invoices by supplier, documents matching the order number, and documents with the same invoice number, and runs a PaperOffice AI duplicate check.
- Reads OCR text from selected historical and order-related documents, extracts evidence (including validated IBANs), and optionally extracts structured data from the purchase order and delivery note.
- Evaluates fraud and overbilling checks (extraction completeness, IBAN match/changed/unknown, possible duplicates, and ordered/delivered quantity mismatches) and writes a check report back onto the invoice document in PaperOffice AI.
- Optionally starts a PaperOffice AI AI-DMS Ultra deep check, then enqueues the invoice into the PaperOffice AI HITL review queue and returns a JSON response indicating the task is queued.
- Receives a signed PaperOffice AI review-decision webhook, verifies the HMAC signature, and tags the invoice in PaperOffice AI as either fraud-check:ready-for-payment or fraud-check:blocked.
Setup
- Create an HTTP Bearer Auth credential with your PaperOffice AI user token (po_ut_…) and use it for all PaperOffice AI HTTP Request nodes.
- Set your PaperOffice AI workspace ID and your HITL agent UUID in the Settings step.
- Configure your PaperOffice AI HITL agent to call the production URL of the review-decision webhook and set the same signing secret in the HMAC signature configuration.
- If you want optional deep checks, ensure your PaperOffice AI plan supports AI-DMS Ultra processing and keep the form option enabled for reviewers/requesters.