{"product_id":"n8n-invoice-extraction-from-gmail-pdfs-to-drive-sheets","title":"n8n Invoice Extraction from Gmail PDFs to Drive \u0026 Sheets","description":"\u003ch3\u003eAutomatically extract invoice details from Gmail PDF attachments—store PDFs in Google Drive and log everything in Google Sheets\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow watches your Gmail inbox for incoming invoice PDFs, extracts the invoice text, uses Anthropic Claude to capture key fields as structured JSON, then saves the original PDF to Google Drive and appends a new record to your Google Sheets “請求書管理” sheet.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePolls Gmail every minute\u003c\/strong\u003e for emails matching \u003cem\u003ehas:attachment filename:pdf\u003c\/em\u003e, then downloads the PDF attachment.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eExtracts text from the attached PDF\u003c\/strong\u003e to obtain the invoice content.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eFeeds extracted text to Anthropic Claude\u003c\/strong\u003e and requests a JSON response containing:\n    \u003cul\u003e\n      \u003cli\u003einvoice_no\u003c\/li\u003e\n      \u003cli\u003eissuer\u003c\/li\u003e\n      \u003cli\u003eamount\u003c\/li\u003e\n      \u003cli\u003edue_date\u003c\/li\u003e\n    \u003c\/ul\u003e\n  \u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eBuilds a standardized filename\u003c\/strong\u003e using the invoice number and combines AI fields with email metadata (sender and received date).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eUploads the original PDF to Google Drive\u003c\/strong\u003e in a specified folder (using OAuth2 credentials).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAppends a row to Google Sheets\u003c\/strong\u003e in the sheet “請求書管理”, including:\n    差出人, 請求元, 受信日時, 支払期限, 請求金額, ファイルURL, 請求書番号.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eAccounts payable teams who receive invoices via email can automatically centralize PDFs and maintain an always-up-to-date invoice register.\u003c\/li\u003e\n  \u003cli\u003eSaaS operators can reduce manual data entry by converting invoice PDFs into structured records within Google Sheets.\u003c\/li\u003e\n  \u003cli\u003eAutomation engineers can use this n8n workflow as a reliable Gmail → PDF text extraction → Claude JSON parsing → Drive\/Sheets pipeline.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n nodes\/integrations:\u003c\/strong\u003e Gmail polling\/trigger, PDF text extraction (extract from file), \u003cstrong\u003eAnthropic Claude\u003c\/strong\u003e (n8nn8n-nodes-langchainanthropic), Code node, Google Drive, Google Sheets.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eConfig requirements:\u003c\/strong\u003e Gmail OAuth2, Anthropic API credentials with JSON-only output format, Google Drive folder ID, and Google Sheets spreadsheet ID + sheet name with columns matching the mapped fields.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46232442405043,"sku":"N8N-21030","price":62.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/wVkunTUCLdli098Q0i7Ul_fYBQewTO.png?v=1792142494","url":"https:\/\/buyflowscripts.com\/products\/n8n-invoice-extraction-from-gmail-pdfs-to-drive-sheets","provider":"N8N Commerce","version":"1.0","type":"link"}