r/AIAgentsInAction • u/ZtasnimS75 • 22h ago
Discussion I built an n8n invoice matching agent where the AI can't override a mismatch
I built a workflow for three-way invoice matching (purchase order, goods receipt, invoice) with fraud flagging.
How it works:
- Plain code does the matching: billed more than received, quantity different from the PO, or unit price more than 5% off
- An AI Agent (Gemini 3.5 Flash Lite) checks vendor history and rates fraud risk
- Any mismatch, or any risk above low, goes to Slack
- Clean invoices are auto-approved, and every check is saved to Postgres (Supabase)
The main design choice: math is handled by rules, judgment by the AI. A mismatch is always escalated, whatever the model says.
It currently runs on mock data and a mock vendor history tool.
Repo: https://github.com/ztsprofessionalaiid7-alt/invoice-fraud-agent-n8n
I'd love feedback: what fraud signals would you add?