AI automation & document intelligence | n8n, Gemini, Python/FastAPI, PostgreSQL, Docker
End-to-End AI Invoice Approval Automation
- Problem
- Finance teams lose time and introduce avoidable errors when invoices arrive in different layouts and must be re-entered before totals, references, duplicates, and approval rules can be checked.
- My Contribution
- Designed and implemented the workflow end to end: multi-file intake, three n8n automations, Gemini extraction, a Python/FastAPI validation service, PostgreSQL workflow history, human review, and duplicate-safe delivery to an ERP sandbox.
Technical details
- Data & Context
- The interface accepts PDF, PNG, and JPEG vendor invoices in batches of up to 20 files. Each document keeps its own source identity, processing state, and audit history.
- Approach
- n8n creates one job for every uploaded file, starts extraction and validation, then routes the result to approval, finance review, or an unreadable-document queue. One failed invoice does not stop the rest of the batch.
- Validation & Controls
- Python rules check file integrity, required fields, totals, currencies, references, dates, duplicates, and approval routing. Docker Compose packages the local services, while an optional Apps Script integration sends final read-only records to Google Sheets.
Project OutputFinance users can upload a batch, review only the values that need attention, authorize ready invoices, and deliver approved records without retyping each document. Failed files remain isolated instead of blocking the full batch.
Evidence & ScopeThe runnable local project includes structured invoice records, exception queues, approval tasks, searchable history, audit events, and duplicate-safe ERP sandbox records across n8n, Gemini, Python/FastAPI, PostgreSQL, and Docker Compose.