Invoice Processing Workflow - The $47K Discovery 🔥
Client 3 changed everything for me. Small logistics company. 320 invoices monthly. AP clerk spending 15 minutes per invoice. Do the math. 80 hours a month. Just data entry. I quoted $1,800 for the automation. They said yes same day. THE BUILD THAT ALMOST FAILED: Built it over a weekend. Gmail trigger watching their AP inbox. Gets the message and downloads the PDF attachment. PDF Vector extracting vendor, amounts, line items into structured JSON with a schema I defined. Validation code checking if line items actually add up to the total. PO lookup matching against their purchase order database. Tested with 10 invoices. Perfect. Day 3? Broke completely. THE PROBLEM I MISSED: Some vendors put totals at top. Others at bottom. A few had multiple pages with running totals. My extraction worked for simple invoices. Complex ones? Math didn't match. Spent 6 hours fixing it. Added a validation code node that catches calculation errors before anything logs. Built 2% tolerance into the PO matching because small rounding differences aren't worth flagging. IF node routes clean invoices to approved path, problems to flagged path. Each path logs to Google Sheets with different status. Approved invoices get confirmation email back to sender. Flagged invoices alert the AP team with specific reasons why. THE UNEXPECTED OUTCOME: Two months in, client calls me. "Your workflow caught something." $8,400 duplicate payment from a vendor. The validation warnings flagged it. Nobody would've noticed manually. Year one results: $47,200 in overpayments and calculation errors caught. My $1,800 setup fee suddenly looked cheap. WHAT I LEARNED: Don't just extract data. Validate it. The validation layer is worth more than the extraction itself. Current workflow runs 12 nodes total. Gmail Trigger catches invoice. PDF Vector extracts everything with JSON schema. Code validates calculations. Sheets lookup matches PO. Another code node checks 2% tolerance. IF routes approved or flagged. Logs to Google Sheets. Sends confirmation or alert email.