n8n

How to Automate Google Drive OCR CSV Export?

Stop typing data from statements and receipts by hand. This build watches a Google Drive folder, reads new PDFs or images, and turns them into clean CSV files you can use in accounting tools. It fits teams that process bank statements, invoices, and receipt photos and need fast, accurate data in a spreadsheet format.

A Google Drive event starts the run when a new file appears. The flow checks the file type, then follows the right path. For PDFs, it downloads the file, pulls the text, sends it to an AI model through OpenRouter to structure the data, converts the result to CSV, and saves it back to Drive with a date based name. For images, it downloads the file, uses Vertex AI with a Gemini model to read the text, then converts and uploads a CSV. Both paths produce consistent, ready to analyze data without manual effort.

Setup needs a Google service account with access to the Drive folder, an OpenRouter API key, Google Cloud Vertex AI enabled, and a Gemini API key. Expect less manual entry, faster monthly close, and fewer errors from messy copy and paste. Great for monthly bank statements, photographed receipts from the field, and simple invoice layouts stored in Drive.

What are the key features?

  • Google Drive file created trigger checks a specific folder every minute using a service account
  • Smart routing by file type sends PDFs and images down separate paths for the best results
  • PDF path downloads the file, extracts the text, and uses an AI model via OpenRouter to structure transactions
  • Image path downloads the image and uses Vertex AI with a Gemini model to read and extract text
  • CSV conversion nodes turn structured outputs into clean, ready to use files
  • Uploads finished CSVs back to a Drive folder with a date based file name for easy tracking
  • Secure credentials across nodes including Google service account, HTTP header auth for OpenRouter, and Gemini API key

What are the benefits?

  • Reduce manual data entry from 1 hour to 3 minutes per file
  • Automate up to 90 percent of repetitive extraction work
  • Improve data accuracy by up to 80 percent compared to manual typing
  • Handle 10 times more documents per day with the same team
  • Connect Google Drive with AI services in one reliable flow

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Google Drive, OpenRouter, Google Cloud Vertex AI and Google Gemini. See the Tools Required section above for links to create accounts with these services.
  3. In Google Cloud, create a service account, enable the Google Drive API, and download the JSON key file. In Google Drive, share the target folder with the service account email so it can read and write files.
  4. In the n8n credentials manager, create a new Google API credential using Service Account and upload the JSON key. Assign this credential to all Google Drive nodes in the workflow.
  5. Open the Google Drive Trigger node and pick the specific folder to watch. Confirm event is file created and polling is every minute.
  6. Open the Switch node and verify rules: equals application/pdf goes to the PDF path and contains image/ goes to the image path.
  7. Open the HTTP Request node labeled Send data to A.I. Create a new credential of type HTTP Header Auth and set Authorization to Bearer YOUR_OPENROUTER_API_KEY. Keep the URL and JSON body as provided.
  8. Get a Google Gemini API key from your Google AI account. In n8n, create a Google Gemini credential and assign it to the Gemini Chat Model node. Ensure the Vertex AI extract node is linked to this LLM.
  9. In your Google Cloud project, enable Vertex AI and grant Vertex AI User roles to the service account used by n8n. In the Vertex AI node, set the correct project and region if fields are available.
  10. Open both Upload to Google Drive nodes and confirm the destination folder and the file name variable. Keep the name set to the current date for easy tracking.
  11. Test the PDF path: upload a bank statement PDF to the watched folder. Confirm a CSV appears in the export folder and check that rows and columns look correct.
  12. Test the image path: upload a clear photo of a receipt. If text is missing, confirm Vertex AI is enabled and the Gemini credential is valid. If the trigger does not fire, make sure the Drive folder is shared with the service account.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Google Cloud Vertex AI

Sign up

Pay-as-you-go: Gemini 2.5 Flash Lite – $0.10 per 1M input tokens, $0.40 per 1M output tokens

Google Drive

Sign up

Drive API: $0 (no additional cost; quota-limited)

Google Gemini

Sign up

Free tier: $0 via Gemini API; e.g., Gemini 2.5 Flash-Lite free limits 1,000 requests/day (15 RPM, 250k TPM). Paid from $0.10/1M input tokens and $0.40/1M output tokens.

OpenRouter

Sign up

Free models: $0 via API, 20 requests/min; 50/day or 1000/day with ≥10 credits

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.