This automated n8n pipeline ingests invoice and receipt PDFs from Gmail or Google Drive, extracts raw text via OCR, and uses an LLM to parse structured fields (vendor, date, line items, total, and currency) into validated JSON. A custom code node then verifies the schema and performs a math check on the totals. Verified data is automatically logged to Google Sheets, while messy scans, math errors, or low-confidence outputs are safely routed to a human review queue with the original file attached.