{"product_id":"gmail-pdf-invoice-extractor-gemini-to-google-sheets-n8n","title":"Gmail PDF Invoice Extractor: Gemini to Google Sheets (n8n)","description":"\u003ch3\u003eTurn Gmail PDF invoices into structured Google Sheets rows—automatically\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow watches your Gmail for unread PDF invoice attachments, extracts the PDF text, uses \u003cstrong\u003eGoogle Gemini\u003c\/strong\u003e to parse key invoice fields into structured JSON, and appends the cleaned results to your \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e—then marks the email as read. Perfect for turning messy invoice emails into clean, searchable data.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eMonitors Gmail for new invoice PDFs\u003c\/strong\u003e by polling every minute for emails matching \u003ccode\u003ehas:attachment filename:pdf label:invoices\u003c\/code\u003e (unread + labeled).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eProcesses each PDF attachment individually\u003c\/strong\u003e by splitting matched emails into separate items so every attachment is extracted and parsed on its own.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eExtracts text from PDFs\u003c\/strong\u003e using n8n’s PDF text extraction node.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eParses invoice data with Google Gemini\u003c\/strong\u003e: sends the email context plus extracted PDF text to Gemini using a predefined JSON schema, returning invoice fields and a confidence score.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNormalizes and validates results\u003c\/strong\u003e by converting dates\/numbers, checking basic consistency (e.g., subtotal + tax vs total), and flagging low-confidence or incomplete outputs as \u003ccode\u003eneeds_review\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWrites to Google Sheets\u003c\/strong\u003e by appending the final invoice row to the \u003ccode\u003eInvoices\u003c\/code\u003e tab, including line items stored as JSON.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eMarks the source Gmail message as read\u003c\/strong\u003e after successful processing.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eSaaS operators consolidating vendor invoices into a single \u003cstrong\u003eGoogle Sheets invoice ledger\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003eAutomation engineers building an \u003cstrong\u003einvoice extraction workflow\u003c\/strong\u003e from email to spreadsheet without manual copy\/paste.\u003c\/li\u003e\n  \u003cli\u003eFinance teams routing uncertain parses for follow-up via the \u003ccode\u003eneeds_review\u003c\/code\u003e flag.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGmail Trigger \/ Gmail node\u003c\/strong\u003e with OAuth2 credentials and the query: \u003ccode\u003ehas:attachment filename:pdf label:invoices\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePDF text extraction\u003c\/strong\u003e using n8n’s PDF extraction capability.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGoogle Gemini (Google AI Studio)\u003c\/strong\u003e to transform extracted text into structured JSON with a confidence score.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGoogle Sheets integration\u003c\/strong\u003e to append invoice rows to the \u003ccode\u003eInvoices\u003c\/code\u003e sheet (use \u003ccode\u003eREPLACE_WITH_YOUR_SPREADSHEET_ID\u003c\/code\u003e).\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46244499652787,"sku":"N8N-21181","price":7.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/gIy8cZ_V5lCn_4Axb9s21_M58ccbyt.png?v=1792400642","url":"https:\/\/buyflowscripts.com\/products\/gmail-pdf-invoice-extractor-gemini-to-google-sheets-n8n","provider":"N8N Commerce","version":"1.0","type":"link"}