{"product_id":"n8n-gmail-pdf-ocr-ai-classification-google-drive-slack","title":"n8n Gmail PDF OCR \u0026 AI Classification → Google Drive, Slack","description":"\u003ch3\u003eAutomatically OCR, classify, and file your PDF invoices \u0026amp; documents from Gmail—into Google Drive with Slack alerts\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow watches your \u003cstrong\u003eGmail\u003c\/strong\u003e inbox for \u003cstrong\u003ePDF attachments\u003c\/strong\u003e, performs \u003cstrong\u003eOCR when needed\u003c\/strong\u003e, uses \u003cstrong\u003eAnthropic Claude\u003c\/strong\u003e to \u003cstrong\u003eclassify and extract key fields\u003c\/strong\u003e, then organizes each PDF into the right \u003cstrong\u003eGoogle Drive\u003c\/strong\u003e folder, logs everything in \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e, and notifies your team in \u003cstrong\u003eSlack\u003c\/strong\u003e.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eRuns every minute in n8n and triggers on emails that match \u003ccode\u003ehas:attachment filename:pdf\u003c\/code\u003e.\u003c\/li\u003e\n  \u003cli\u003eDownloads all PDF attachments and splits the email into \u003cem\u003eone item per attachment\u003c\/em\u003e so each PDF is processed individually.\u003c\/li\u003e\n  \u003cli\u003eUses \u003cstrong\u003epdfRest\u003c\/strong\u003e to read PDF metadata (including \u003cstrong\u003epage count\u003c\/strong\u003e) and detect whether the PDF is \u003cstrong\u003eimage-only\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003eIf OCR is needed, runs \u003cstrong\u003epdfRest OCR\u003c\/strong\u003e to make scanned documents searchable.\u003c\/li\u003e\n  \u003cli\u003eConverts the PDF to \u003cstrong\u003eMarkdown\u003c\/strong\u003e via pdfRest, then uses \u003cstrong\u003en8n’s Information Extractor\u003c\/strong\u003e with \u003cstrong\u003eAnthropic Claude\u003c\/strong\u003e to classify the document and extract fields such as \u003cstrong\u003ecounterparty\u003c\/strong\u003e and \u003cstrong\u003edocument date\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003eRoutes the document based on the extracted classification (e.g., \u003cstrong\u003einvoice\u003c\/strong\u003e, \u003cstrong\u003econtract\u003c\/strong\u003e, \u003cstrong\u003ecorrespondence\u003c\/strong\u003e, or \u003cstrong\u003eother\u003c\/strong\u003e), and uploads the PDF to the corresponding \u003cstrong\u003eGoogle Drive\u003c\/strong\u003e folder with a structured filename.\u003c\/li\u003e\n  \u003cli\u003eAppends a row to a \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e index with email details, extracted fields, \u003cstrong\u003epage count\u003c\/strong\u003e, OCR flag, and the \u003cstrong\u003eGoogle Drive link\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003eSends a one-line \u003cstrong\u003eSlack\u003c\/strong\u003e notification containing the same Drive link.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eAuto-file incoming vendor invoices from Gmail into the correct Google Drive folder for faster AP workflows.\u003c\/li\u003e\n  \u003cli\u003eProcess scanned contracts and ensure OCR + metadata extraction before archiving.\u003c\/li\u003e\n  \u003cli\u003eMaintain an audit-friendly document index in Google Sheets with Slack alerts for newly received documents.\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 Gmail (search query: \u003ccode\u003ehas:attachment filename:pdf\u003c\/code\u003e) every minute\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOCR \u0026amp; PDF handling:\u003c\/strong\u003e \u003cstrong\u003epdfRest\u003c\/strong\u003e community node (\u003ccode\u003e@pdfrest\/n8n-nodes-pdfrest\u003c\/code\u003e)\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAI extraction:\u003c\/strong\u003e \u003cstrong\u003eAnthropic Claude\u003c\/strong\u003e via n8n Information Extractor\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIntegrations:\u003c\/strong\u003e Google Drive, Google Sheets, Slack\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWorkflow components:\u003c\/strong\u003e \u003cstrong\u003eif\u003c\/strong\u003e, \u003cstrong\u003eset\u003c\/strong\u003e, \u003cstrong\u003ecode\u003c\/strong\u003e, \u003cstrong\u003emerge\u003c\/strong\u003e, \u003cstrong\u003eslack\u003c\/strong\u003e, \u003cstrong\u003eswitch\u003c\/strong\u003e\n\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46058948657331,"sku":"N8N-19694","price":64.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/Eu965nLLCFYD_AWxWsIA4_jRQuHDzj.png?v=1789722414","url":"https:\/\/buyflowscripts.com\/products\/n8n-gmail-pdf-ocr-ai-classification-google-drive-slack","provider":"N8N Commerce","version":"1.0","type":"link"}