{"product_id":"n8n-ocr-invoice-extractor-google-drive-to-sheets-ollama","title":"n8n OCR Invoice Extractor: Google Drive to Sheets + Ollama","description":"\u003ch3\u003eAutomate invoice OCR + extraction from Google Drive straight into Google Sheets (with Ollama)\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow watches a Google Drive folder for new invoice files, runs OCR through a local HTTP endpoint, uses an Ollama LLM to extract structured invoice fields, and appends the results to your Google Sheet—automatically avoiding duplicates by tracking processed Drive file IDs.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cp\u003eBuilt for invoice data capture, it follows this flow:\u003c\/p\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eTriggers\u003c\/strong\u003e manually or when a \u003cstrong\u003enew file is created\u003c\/strong\u003e in a configured \u003cstrong\u003eGoogle Drive folder\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDiscovers inputs\u003c\/strong\u003e by listing files in the target folder and reading the \u003cstrong\u003eheader row\u003c\/strong\u003e from a specified \u003cstrong\u003eGoogle Sheets worksheet\u003c\/strong\u003e to know which fields to extract.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePrevents re-processing\u003c\/strong\u003e by reading existing Google Sheets rows, collecting previously processed Drive \u003cstrong\u003efile IDs\u003c\/strong\u003e, and filtering out already recorded files.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDownloads and OCRs\u003c\/strong\u003e each unprocessed invoice from Google Drive, sending the file to a \u003cstrong\u003elocal OCR HTTP API\u003c\/strong\u003e using a \u003cstrong\u003emultipart request\u003c\/strong\u003e to obtain extracted text.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eExtracts structured data\u003c\/strong\u003e by sending the OCR text to an \u003cstrong\u003eOllama chat model\u003c\/strong\u003e with instructions to return \u003cstrong\u003eraw JSON\u003c\/strong\u003e for the requested headers.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWrites back results\u003c\/strong\u003e by parsing\/normalizing the JSON output, reattaching the Drive \u003cstrong\u003efile ID\u003c\/strong\u003e and \u003cstrong\u003efilename\u003c\/strong\u003e, and appending the new row(s) to the same Google Sheet.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eCapture invoice line headers and metadata from scanned PDFs into Google Sheets for reporting.\u003c\/li\u003e\n  \u003cli\u003eTurn a shared “Invoices” folder into a lightweight invoice ingestion pipeline for SaaS operators.\u003c\/li\u003e\n  \u003cli\u003eAutomate back-office extraction without manual copy\/paste from OCR to spreadsheets.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eIntegrations \/ nodes:\u003c\/strong\u003e code, merge, sticky note, \u003cstrong\u003eGoogle Drive\u003c\/strong\u003e, \u003cstrong\u003eHTTP Request\u003c\/strong\u003e, \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOCR endpoint:\u003c\/strong\u003e requires a reachable local OCR HTTP service that returns extracted text from multipart uploads.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGoogle Sheets schema:\u003c\/strong\u003e first header cell must be exactly \u003cstrong\u003e“Id”\u003c\/strong\u003e, with additional column headers for every field the LLM should extract.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eLLM layer:\u003c\/strong\u003e \u003cstrong\u003eOllama\u003c\/strong\u003e produces raw JSON, which the workflow parses and appends to Sheets.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45785760596147,"sku":"N8N-17893","price":16.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/QAUDFDRl46b4skD5OB04V_GIz5IMyI.png?v=1786180586","url":"https:\/\/buyflowscripts.com\/products\/n8n-ocr-invoice-extractor-google-drive-to-sheets-ollama","provider":"N8N Commerce","version":"1.0","type":"link"}