{"product_id":"n8n-google-drive-ocr-gpt-4o-extract-to-google-sheets","title":"n8n Google Drive OCR \u0026 GPT-4o Extract to Google Sheets","description":"\u003ch3\u003eAutomatically OCR documents in Google Drive and log structured case data to Google Sheets\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow watches a Google Drive inbox folder, downloads newly added files, uses OpenAI \u003cstrong\u003eGPT-4o-mini\u003c\/strong\u003e to OCR and extract strict structured metadata, then appends the results to \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e—archiving successful files and routing failures to an error folder.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eTriggers on new documents\u003c\/strong\u003e in a specified Google Drive inbox folder (or can process all existing inbox files when run manually).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReads existing Google Sheets rows\u003c\/strong\u003e to provide context for \u003cstrong\u003ecase assignment\u003c\/strong\u003e and \u003cstrong\u003eduplicate detection\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDownloads each Drive file\u003c\/strong\u003e and sends it to OpenAI (GPT-4o-mini) to perform OCR and return a \u003cstrong\u003estrict JSON extraction\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003eExtracts structured fields such as \u003cstrong\u003esender\u003c\/strong\u003e, \u003cstrong\u003etype\u003c\/strong\u003e, \u003cstrong\u003edates\u003c\/strong\u003e, \u003cstrong\u003edeadlines\u003c\/strong\u003e, \u003cstrong\u003eamounts\u003c\/strong\u003e, \u003cstrong\u003etax relevance\u003c\/strong\u003e, \u003cstrong\u003ecase linkage\u003c\/strong\u003e, and \u003cstrong\u003eduplicate information\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNormalizes output into a Google Sheets row\u003c\/strong\u003e, generating a new \u003cstrong\u003ecase ID\u003c\/strong\u003e and \u003cstrong\u003edocument ID\u003c\/strong\u003e when needed, enforcing consistency rules (including clearing the “next action” when not required), and setting a \u003cstrong\u003estatus\u003c\/strong\u003e based on any extracted deadline.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAppends to Google Sheets\u003c\/strong\u003e, waits briefly to reduce rate-limit pressure, then \u003cstrong\u003emoves the processed file\u003c\/strong\u003e to a Drive archive folder.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eError handling:\u003c\/strong\u003e if AI analysis fails, it logs an \u003cstrong\u003eerror row\u003c\/strong\u003e in Google Sheets and moves the file to a dedicated Drive error folder.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eCapture and classify invoices or correspondence dropped into a Google Drive inbox.\u003c\/li\u003e\n  \u003cli\u003eAutomatically extract deadlines and amounts, then update case tracking in Google Sheets.\u003c\/li\u003e\n  \u003cli\u003ePrevent duplicate records by comparing AI-extracted metadata against existing Sheets rows.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003en8n workflow\u003c\/strong\u003e with: \u003cstrong\u003eManual Trigger\u003c\/strong\u003e, \u003cstrong\u003eCode\u003c\/strong\u003e, \u003cstrong\u003eGoogle Drive\u003c\/strong\u003e, \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e, \u003cstrong\u003eNo Op\u003c\/strong\u003e, and \u003cstrong\u003eWait\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003eUses \u003cstrong\u003eOpenAI GPT-4o-mini\u003c\/strong\u003e for OCR + strict JSON extraction.\u003c\/li\u003e\n  \u003cli\u003eRequires \u003cstrong\u003eGoogle OAuth2 credentials\u003c\/strong\u003e and configuration of inbox, archive, and error folder IDs in Google Drive, plus the target Google Sheets document.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46047391187123,"sku":"N8N-19651","price":39.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/S3x32zZD7HDf-Gki9cpIB_bxxXgzb4.png?v=1789636570","url":"https:\/\/buyflowscripts.com\/products\/n8n-google-drive-ocr-gpt-4o-extract-to-google-sheets","provider":"N8N Commerce","version":"1.0","type":"link"}