← All N8N workflows
Data & databasesCodeGoogle DriveGoogle Drive TriggerGoogle SheetsHTTP Request

OCR receipts from Google Drive

Configured with Google Drive, Google Drive Trigger, Google Sheets, HTTP Request. Review the connections and setup before adapting this template.

Workflow preview
TriggerWhen clicking ‘Testworkflow’Manual TriggerWeb / APIOCR recognizeHTTP RequestCodeUnserialize responseJSONCodeTriggerOn new file in GoogleDriveGoogle Drive TriggerFiles / mediaLoad files from GoogleDrive folderGoogle DriveTransformFilter processed filesMergeFiles / mediaDownload file for OCRGoogle DriveData storeSave OCR result intoSheetsGoogle SheetsData storeGet already processedrows from SheetsGoogle Sheets

Node categories in this workflow

  • Trigger
  • Web / API
  • Code
  • Files / media
  • Transform
  • Data store

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
When clicking ‘Test workflow’TriggerManual TriggerSee node parameters
OCR recognizeWeb / APIHTTP RequestPOST
Unserialize response JSONCodeCodeSee node parameters
On new file in Google DriveTriggerGoogle Drive TriggerSee node parameters
Load files from Google Drive folderFiles / mediaGoogle DrivefileFolder
Filter processed filesTransformMergeSee node parameters
Download file for OCRFiles / mediaGoogle Drivedownload
Save OCR result into SheetsData storeGoogle SheetsappendOrUpdate
Get already processed rows from SheetsData storeGoogle SheetsSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • googleDriveOAuth2Api
  • googleSheetsOAuth2Api
  • httpHeaderAuth

Workflow notes

Recognize invoices and convert them into structured JSON

Recognize invoices and convert them into structured JSON

Video Demo

https://youtu.be/mGPt7fqGQD8

Quick OCR playground

1. Get your OakPDF OCR API key here:

https://rapidapi.com/restyler/api/receipt-and-invoice-ocr-api

2. Poceed to the OCR Playground and upload your document or use example files:

https://ocr.oakpdf.com/

The API can recognize any document format: medical, financial, legal -- let me know which format you want to try and I will be happy to add it to the Playground!

Running the n8n Workflow

This workflow allows you to recognize a folder with receipts or invoices (make sure your files are in .pdf, .png, or .jpg format). The workflow can be triggered via the "Test workflow" button, and it also monitors the folder for new files, automatically recognizing them.

1. n8n import glitch

After import, the trigger node "When clicking 'Test workflow'" might be disconnected. You need to connect it via 2 arrows to "Google Sheets1" and "Google Drive" nodes. So, the workflow has 2 triggers - via button, and via Google Sheets "new file" event - both of these triggers should be connected to 2 nodes. Here is how it should looks like: https://ocr.oakpdf.com/n8n_fix.png

2. Set up RapidAPI HTTP auth key

Create new "HTTP header" n8n credential and paste your RapidAPI key from https://rapidapi.com/restyler/api/receipt-and-invoice-ocr-api into it. https://ocr.oakpdf.com/n8n_api_key.png

Make sure "HTTP Request" node uses this credential.

3. Set up your Google Auth

You need a Google connection to work with your Google Sheets and Google Drive accounts: https://docs.n8n.io/integrations/builtin/credentials/google/oauth-generic/#finish-your-n8n-credential

4. Set up Google Sheets

Copy this Google Sheets document: https://docs.google.com/spreadsheets/d/REPLACE_WITH_DOCUMENT_ID/edit?usp=sharing

Custom document formats and advanced usage

Email: user@example.com Linkedin: https://www.linkedin.com/in/anthony-sidashin/

OCR receipts from Google Drive

OCR receipts from Google Drive

Purpose and structure

This folder contains the OCR receipts from Google Drive workflow. Its executable nodes use code, googleDrive, googleDriveTrigger, googleSheets, httpRequest, manualTrigger, merge. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

When clicking ‘Test workflow’, On new file in Google Drive

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Code/1839_Code_Manual_Automation_Webhook.json MIT; preserve source notices.

More in Data & databases