{"product_id":"gmail-invoice-automation-in-n8n-drive-save-pdf-co-extract","title":"Gmail Invoice Automation in n8n: Drive Save + PDF.co Extract","description":"\u003ch3\u003eAutomatically save Gmail invoice PDFs, extract totals with Claude, and log everything to Google Sheets\u003c\/h3\u003e\n\u003cp\u003eThis \u003cstrong\u003eGmail Invoice Automation in n8n\u003c\/strong\u003e watches your inbox for invoice\/receipt emails, stores the PDFs in a clean \u003cstrong\u003eGoogle Drive YYYY\/YYYY-MM\u003c\/strong\u003e folder structure, uses \u003cstrong\u003eAnthropic Claude\u003c\/strong\u003e to extract key invoice fields, and appends them to a monthly \u003cstrong\u003eInvoices YYYY-MM\u003c\/strong\u003e Google Sheets file—then labels each processed email so it won’t run twice.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eChecks Gmail every 15 minutes\u003c\/strong\u003e for messages matching your invoice\/receipt search and not yet labeled \u003cstrong\u003einvoices-processed\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDownloads attachments\u003c\/strong\u003e on matching emails.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDetermines the filing period\u003c\/strong\u003e from the email date (with an option to file to the previous month).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDetects invoice links\u003c\/strong\u003e inside the email body (when applicable).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFinds or creates Drive folders\u003c\/strong\u003e: a year folder (\u003cstrong\u003eYYYY\u003c\/strong\u003e) and a month folder (\u003cstrong\u003eYYYY-MM\u003c\/strong\u003e) under your chosen root invoices folder.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGets the PDF\u003c\/strong\u003e from attachments, or retrieves\/produces a PDF from the detected invoice source using \u003cstrong\u003ePDF.co\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eExtracts invoice data\u003c\/strong\u003e by sending each invoice PDF to \u003cstrong\u003eAnthropic Claude\u003c\/strong\u003e to extract: supplier name, VAT\/tax ID, issue date, amount, and currency.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eUploads and logs\u003c\/strong\u003e: saves the PDF to the month folder and appends a row to the matching \u003cstrong\u003eInvoices YYYY-MM\u003c\/strong\u003e Google Sheets file (creating\/moving the sheet within the month folder if needed).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePrevents reprocessing\u003c\/strong\u003e by adding the \u003cstrong\u003einvoices-processed\u003c\/strong\u003e label to the Gmail message.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eSaaS operators consolidating invoice documentation for monthly accounting.\u003c\/li\u003e\n  \u003cli\u003eAutomation engineers building a reliable inbox-to-Drive invoice archive with structured reporting.\u003c\/li\u003e\n  \u003cli\u003eTeams wanting automatic PDF storage plus extracted totals (amount, currency, VAT\/tax ID) in Google Sheets.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eTrigger\u003c\/strong\u003e: periodic run every 15 minutes from \u003cstrong\u003eGmail\u003c\/strong\u003e (invoice\/receipt search, label check).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eCore logic\u003c\/strong\u003e: \u003cstrong\u003eif\u003c\/strong\u003e, \u003cstrong\u003eset\u003c\/strong\u003e, \u003cstrong\u003ecode\u003c\/strong\u003e, and \u003cstrong\u003eno op\u003c\/strong\u003e nodes for routing and data handling.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePDF handling\u003c\/strong\u003e: \u003cstrong\u003ePDF.co\u003c\/strong\u003e for PDF generation from invoice links (when needed).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAI extraction\u003c\/strong\u003e: \u003cstrong\u003eAnthropic Claude\u003c\/strong\u003e for structured invoice field extraction.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eStorage \u0026amp; reporting\u003c\/strong\u003e: \u003cstrong\u003eGoogle Drive\u003c\/strong\u003e (YYYY\/YYYY-MM folders) and monthly \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSetup requirement\u003c\/strong\u003e: create\/select a Gmail label named \u003cstrong\u003einvoices-processed\u003c\/strong\u003e, connect Gmail OAuth2 and Google Drive.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46248904949939,"sku":"N8N-21206","price":45.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/rUk0RBcCGb2FZZJ0nTNfd_UvUnePrR.png?v=1792487381","url":"https:\/\/buyflowscripts.com\/products\/gmail-invoice-automation-in-n8n-drive-save-pdf-co-extract","provider":"N8N Commerce","version":"1.0","type":"link"}