{"product_id":"n8n-gmail-invoice-automation-groq-to-drive-sheets","title":"n8n Gmail Invoice Automation: Groq to Drive \u0026 Sheets","description":"\u003ch3\u003eAutomatically save Gmail invoices to Google Drive and keep your Billing Ledger updated with Groq\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow watches your inbox for financial emails, uses \u003cstrong\u003eGroq LLMs\u003c\/strong\u003e to classify and extract invoice\/receipt details from attachments, uploads the documents into a structured `YYYY\/MM` Google Drive folder, and upserts the results into a \u003cstrong\u003eBilling_Ledger\u003c\/strong\u003e in \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e. When everything is done, it sends a \u003cstrong\u003eTelegram\u003c\/strong\u003e notification.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGmail monitoring every minute:\u003c\/strong\u003e Triggers from a Gmail Trigger, skips emails in the \u003cem\u003ePromotions\u003c\/em\u003e category, and applies an \u003cem\u003einProgress\u003c\/em\u003e label to track processing.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFetch + normalize email content:\u003c\/strong\u003e Retrieves the full Gmail message (including attachments), cleans the email body, and extracts attachment text via the \u003cstrong\u003eany-file2json-converter\u003c\/strong\u003e sub-workflow when available.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGroq-based email classification:\u003c\/strong\u003e Uses a Groq chat model to classify the email (e.g., financial\/actionable\/informational\/Other), generate a cleaned “body core,” and then runs \u003cstrong\u003erecord-search\u003c\/strong\u003e and \u003cstrong\u003esmart-CRM-fill\u003c\/strong\u003e sub-workflows for contact\/CRM enrichment.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAttachment-by-attachment invoice extraction:\u003c\/strong\u003e Routes only “financial” emails (optionally filtered by a sender whitelist), then uses Groq to classify each document as \u003cstrong\u003eInvoice\u003c\/strong\u003e or \u003cstrong\u003eReceipt\u003c\/strong\u003e and extract structured invoice fields.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGoogle Drive organization + labeling:\u003c\/strong\u003e Derives the target year\/month\/category path, locates or creates it via \u003cstrong\u003egdrive-recursion\u003c\/strong\u003e, uploads the attachment, and applies a Gmail label indicating the document was saved.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLedger upsert to Google Sheets:\u003c\/strong\u003e Consolidates extracted data into \u003cstrong\u003eone ledger row per invoice\u003c\/strong\u003e, using a stable synthetic key when no invoice number exists, and updates the \u003cstrong\u003eBilling_Ledger\u003c\/strong\u003e (upsert behavior).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eTelegram completion alert:\u003c\/strong\u003e Notifies you when processing finishes.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eSaaS operators who receive recurring invoices in Gmail and want them archived automatically.\u003c\/li\u003e\n  \u003cli\u003eTeams that need a reliable \u003cstrong\u003eBilling_Ledger\u003c\/strong\u003e in Google Sheets without manual data entry.\u003c\/li\u003e\n  \u003cli\u003eFinance workflows that require consistent Drive folder structure and searchable document labeling.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n integrations\/nodes:\u003c\/strong\u003e gmail, if, set, code, merge, switch\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLLM:\u003c\/strong\u003e Groq chat model for classification + extraction\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eSub-workflows:\u003c\/strong\u003e any-file2json-converter, record-search, smart-CRM-fill, gdrive-recursion\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOutputs:\u003c\/strong\u003e Google Drive upload + folder path logic, Google Sheets Billing_Ledger upsert, Telegram notification\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46018953838771,"sku":"N8N-19555","price":49.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/IDEsPfWF7DKWbeG3PelCB_589l5mVK.png?v=1789376642","url":"https:\/\/buyflowscripts.com\/products\/n8n-gmail-invoice-automation-groq-to-drive-sheets","provider":"N8N Commerce","version":"1.0","type":"link"}