Scan, Sign & AI Chat
Mobile App
The mobile app pairs with your account via QR code and brings scanner, signature, chat and documents to your phone.
A batch scan comes in, and at the end, every document is recognized, filed, checked and matched with its order. Where something does not fit, a human decides. First the result of a real run, then the build in n8n in ten stages.
Hello and welcome to the PaperOffice AI Academy. In this episode, we build a smart inbox in n8n that thinks along with you. A batch scan comes in, and at the end, every document is recognized, filed, checked, and matched with its order. Where something doesn’t fit, a human decides.
Before we build anything, let’s look at the result first. A real run. After that, we’ll build it step by step. Our example is a batch scan with six pages: one purchase order, one delivery note, and four invoices. On one of them, a new bank account number suddenly appears. I’m sending the batch scan to the webhook. Six pages in one PDF, just as they come out of the scanner. In the execution list, the run starts. Split separates the documents, IDP reads the fields, and every flagged invoice goes through the Ultra check. This takes a few minutes, so I fast-forward. The run has recognized six documents, filed them, and matched the orders. For every document with a reason, a task is now waiting. And the workflow sleeps and waits for us. In PaperOffice, the tasks are listed under Human in the Loop, each with its reason. PaperOffice already knows this invoice. It is the second copy of the Iberica invoice, with a receipt stamp. The workflow reports the duplicate, and the review view names the original. I reject it, with a reason. For this invoice, the check reports a high fraud risk: the supplier gives a new bank account. From a score of seven, a document is automatically quarantined. I reject this one too. The invoice for forty-seven thousand five hundred euros is unremarkable. Before I approve it, I confirm the extracted fields. Then: Approve. I decide the remaining three tasks the same way. Every decision wakes the run through the second webhook. After the last one, it is done: about thirty minutes, and most of that time it was waiting for us. The result in PaperOffice: the approved documents are in Northstar Documents, and the invoices are revision-secure until the end of 2036. Under Activities, there’s the workflow’s note. The duplicate is in the Quarantine workspace, with a legal hold and a note as well. It can no longer be deleted. And this is exactly the inbox we’re building now, step by step, with plain HTTP nodes in n8n. Ten stages.
Stage one is the input. I have prepared the nodes for each stage. I paste them in and move them into place. The Webhook receives the file via POST. It is protected by Header-Auth: Only those who send the correct key in the header are granted access. Responses are not automatic but are handled through dedicated response nodes. If the file is missing, the process proceeds directly to the response, and the sender immediately receives a clear error message.
Stage two is the Split Agent. I connect it to the input, specifically to the branch where the file is located. A single call to the PaperOffice API, a POST to the job interface. The credentials are stored as Header-Auth in n8n, not within the node itself. The body holds the template pdf_ai_split, the ultra model, the processing lane, a rule for file names, the language and, of course, the file. The task is running in the background. Therefore, the workflow polls the job every six seconds until it is complete. Once the batch has been split, the workflow responds with 202 Accepted and carries on with the rest, without making the sender wait.
Stage three goes document by document. The loop always takes exactly one document from the Split Agent’s result. Then the workflow downloads the document file via its download link.
Stage four is the IDP Agent. Once again, a single call, this time using the template document_idp. For invoices, purchase orders, and delivery notes, the following fields are returned: supplier, number, date, amounts and line items, along with their corresponding locations in the original document.
Stage five: Filing and Knowledge Graph. document-put places the document into the Workspace n8n Procurement. procurement_bind then links the invoice and the delivery note to their order, using the purchase order number the IDP Agent found.
Stage six is AI-DMS Ultra. Not every document requires full analysis; therefore, rules are provided here. An amount over 1,000 euros, a mismatch in the document type, a missing mandatory amount, or a deviation in the three-way match. If a rule applies, the workflow orders Ultra for exactly this document.
Stage seven: audit and review task. The workflow reads the fraud risk and its reasoning from the document. Through the task interface, it then creates a task for a human: specifying who will review it, the deadline, the urgency level, and the associated document. This is where a parser reaches its limit. LlamaParse and Mistral OCR provide text and structure. They do not include a verification process with task, assignment, deadline, and proof. You would need to build that yourself.
Stage eight is the three-way match. The loop has two outputs. The first one fires when all documents are done. I connect it to the three-way match. procurement_review checks each transaction: Do the purchase order, delivery note, and invoice match in terms of the header amount and line items? If there are any deviations, this will also generate a task.
Stage nine: Waiting for the human. The workflow registers with its wake-up address at PaperOffice and then goes to sleep without a time limit. When a decision is made in PaperOffice, PaperOffice reports the decision to a second webhook. It looks up which run is waiting for this task and wakes it up.
Stage ten applies the decision. On approval, the workflow lifts an audit lock, using the approved task as proof. Then the document moves to the Northstar Documents workspace, and invoices are made revision-secure, with a retention period starting at year-end. In the event of a rejection, the document remains locked and is assigned a Legal Hold. In both cases, the workflow writes a note to the file and then waits for the next decision. Ten stages, one workflow, and everything runs on one platform: one contract, data in the EU, no subprocessors. Data in, data out. And once the documents are in PaperOffice, even more is possible without a new component: the phone agent, questions from Claude or ChatGPT via MCP, search, and workflows in the app. In the upcoming episodes, we will take a closer look at individual agents, such as Split, IDP, and Redact. Until then: Happy building.
AI-DMS
Documents. Intelligence. Real impact.
PaperOffice AI is the AI-DMS. Four functional areas on one DMS foundation, with three ways in.
Features, modules and benefits at a glance.
Capture, organize, search and collaborate on documents.
Plug into your systems and AI workflows.