The node contracts
Each node carries a contract — what comes in, what happens, what goes out. This is the text your AI receives, node for node, when you hand the graph over.
Receive invoice Input
Entry point of the process. An invoice arrives as a PDF or image — by email to invoices@, by upload, or forwarded by a colleague. Capture the file together with its source and arrival date. No interpretation happens here; the document is passed on exactly as received.
- → leads to Extract invoice data
Extract invoice data
Read the document and produce a structured record: vendor name, invoice number, invoice date, due date, currency, net amount, tax, gross amount, purchase order number if present, and line items with quantities and unit prices. Keep the original wording of line items — do not normalise or translate them. If a field cannot be read with confidence, record it as missing rather than guessing a value.
- → leads to Complete?
- ← comes from Receive invoice
- ← comes from Compliance check — check fails → correct (max 2)
Complete? Decision
Check the extracted record against the required fields: vendor, invoice number, date, gross amount, tax rate, and a deliverable purchase order number or an explicit note that no PO exists. The outgoing branches are exclusive: an invoice is either complete and moves on, or specific fields are missing and it goes to clarification.
- → leads to Match against PO — all fields present
- → leads to Request missing details — fields missing
- ← comes from Extract invoice data
- ← comes from Request missing details — details received
Request missing details
Write to the vendor (or the colleague who forwarded the invoice) and name the exact missing fields — never send a generic "please provide more information". Include the invoice number and a reply-by date seven days out. When the answer arrives, merge the new details into the record and send it back through the completeness check. If the reply-by date passes without an answer, park the invoice and notify accounting.
- → leads to Complete? — details received
- ← comes from Complete? — fields missing
Match against PO Decision
Compare the invoice against the referenced purchase order: vendor must match, gross amount must be within 2% or 50 of the PO total, and every line item must map to an ordered position. Quantity overruns are a mismatch; price rounding inside the tolerance is not. Invoices that declare "no PO" match only if the amount is under the no-PO limit defined by accounting.
- → leads to Determine approver — matches PO
- → leads to Flag for manual review — mismatch
- ← comes from Complete? — all fields present
Flag for manual review
The mismatch cannot be resolved automatically. Create a review task that contains the invoice, the purchase order, and a one-paragraph statement of exactly what differs — amounts, quantities or vendor. A human decides: accept the difference, dispute with the vendor, or reject. Their decision and reasoning are attached to the record before it continues to the audit trail.
- → leads to Compliance check — with reviewer decision
- ← comes from Match against PO — mismatch
Determine approver Decision
Route by gross amount. Up to 1,000: auto-approve, no human involved. From 1,000 to 10,000: the budget owner of the cost centre on the PO. Above 10,000: budget owner plus finance lead, both must approve. If the budget owner is the person who submitted the invoice, approval moves one level up — nobody approves their own spending.
- → leads to Compliance check — approvals collected
- ← comes from Match against PO — matches PO
Compliance check Evaluator
Before payment is released, verify: the tax rate is valid for the vendor's country, the cost centre exists and is open, the approval chain matches the routing rule, and the vendor's bank details equal the ones on file — a changed IBAN always fails this check. If any criterion fails, send the record back to extraction with the specific failure named, at most twice. After the second failure, stop and hand the case to accounting with the full history.
- → leads to Approved for payment — all checks pass
- → leads to Extract invoice data — check fails → correct (max 2)
- ← comes from Flag for manual review — with reviewer decision
- ← comes from Determine approver — approvals collected
Approved for payment Output
The result of the process: an invoice record marked approved, carrying the extracted data, the match result, every approval with name and timestamp, and the compliance confirmation. It is handed to the payment run and written to the audit trail. Nothing after this node changes the record.
- ← comes from Compliance check — all checks pass