{"product_id":"n8n-invoice-ocr-to-csv-google-sheets-via-webhook","title":"n8n Invoice OCR to CSV \u0026 Google Sheets via Webhook","description":"\u003ch3\u003eTurn Invoice PDFs\/Images into CSV + Google Sheets in One Webhook\u003c\/h3\u003e\n\u003cp\u003eSend an invoice file to an \u003cstrong\u003en8n webhook\u003c\/strong\u003e, and this workflow will extract key invoice fields using \u003cstrong\u003eOCR.space\u003c\/strong\u003e, parse line items with deterministic rules, then return the results as \u003cstrong\u003eJSON\u003c\/strong\u003e—while also generating a \u003cstrong\u003eCSV\u003c\/strong\u003e and (optionally) appending the record to \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAccepts uploads via HTTP POST\u003c\/strong\u003e: receive an invoice PDF\/image in a binary field named \u003cstrong\u003einvoice\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eRuns OCR with OCR.space\u003c\/strong\u003e: forwards the file to the OCR.space API to extract text.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eHandles OCR failures\u003c\/strong\u003e: if OCR.space does not succeed, the workflow returns a \u003cstrong\u003e422 JSON error response\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eParses invoice data\u003c\/strong\u003e: extracts vendor, invoice number, invoice date, subtotal, tax, and total, plus \u003cstrong\u003eline items\u003c\/strong\u003e using deterministic rules.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAdds validation flags\u003c\/strong\u003e: generates flags for missing fields and line-item calculation mismatches.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eGenerates a CSV\u003c\/strong\u003e: converts extracted fields into a CSV file and writes it to disk (default path: \u003cstrong\u003e.\/output\/\u003c\/strong\u003e).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOptionally updates Google Sheets\u003c\/strong\u003e: appends the extracted record to a worksheet.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eReturns extracted results\u003c\/strong\u003e: responds with the extracted invoice data, including flags and raw OCR text.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eAutomate AP data capture by converting invoice PDFs into structured records for finance workflows.\u003c\/li\u003e\n  \u003cli\u003eCentralize invoicing data in \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e for visibility and lightweight reporting.\u003c\/li\u003e\n  \u003cli\u003eBuild an internal tool that uploads invoices to an \u003cstrong\u003en8n webhook\u003c\/strong\u003e and immediately receives parsed JSON.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOCR.space\u003c\/strong\u003e integration via HTTP request (header auth uses \u003cstrong\u003eapikey\u003c\/strong\u003e).\u003c\/li\u003e\n  \u003cli\u003eUses \u003cstrong\u003ewebhook\u003c\/strong\u003e, \u003cstrong\u003ehttp request\u003c\/strong\u003e, \u003cstrong\u003eif\u003c\/strong\u003e, \u003cstrong\u003ecode\u003c\/strong\u003e, and \u003cstrong\u003eGoogle Sheets\u003c\/strong\u003e nodes (plus sticky note documentation).\u003c\/li\u003e\n  \u003cli\u003eRequires write access to the configured CSV output path (default: \u003cstrong\u003e.\/output\/\u003c\/strong\u003e).\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":46132886995123,"sku":"N8N-20158","price":20.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/nsQ6uuNnuBhBC-UTH6avp_tAXYeRGG.png?v=1790759848","url":"https:\/\/buyflowscripts.com\/products\/n8n-invoice-ocr-to-csv-google-sheets-via-webhook","provider":"N8N Commerce","version":"1.0","type":"link"}