n8n

How to Automate Google Drive Statement CSV Export?

New PDFs and images dropped into a Google Drive folder turn into clean CSV files ready for finance work. Teams move from messy statements and receipts to structured rows in minutes. It is built for reconciliation, expense tracking, and audit support.

The flow watches a specific folder in Drive and checks each new file. A router sends PDFs down one path and images down another. For PDFs, the file is downloaded, text is extracted, then an AI model on OpenRouter turns the content into clear columns before saving a CSV back to Drive. For images, the file is downloaded and read with Vertex AI using a Gemini model to capture the text, then the data is saved as CSV in a Drive folder. Using two paths gives better accuracy because each file type uses the right tool.

Setup needs a Google service account that can access the folder, an OpenRouter API key, and access to Gemini and Vertex AI in your Google Cloud project. Expect strong time savings and fewer copy and paste errors on bank statements and receipts. Teams that manage monthly statements, vendor invoices, or card receipts will see quick results and easier reporting.

What are the key features?

  • Google Drive watch on a specific folder to catch new PDFs and images every minute
  • Smart routing by file type using a switch that reads the MIME type
  • PDF path: download, extract text, send to OpenRouter for structured fields, then convert to CSV
  • Image path: download, read text with Vertex AI using a Gemini model, then convert to CSV
  • CSV files saved back to a selected Google Drive folder with a clear date based name
  • Service account authentication for secure Drive access without user prompts

What are the benefits?

  • Reduce manual data entry from hours to minutes by turning uploads into ready CSV files
  • Automate up to 90 percent of repetitive statement and receipt processing
  • Improve data accuracy by up to 95 percent by removing copy and paste steps
  • Handle large volumes by processing files as they arrive in Drive
  • Connect Google Drive with AI tools to unify intake and output in one place

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, Google Vertex AI, Google Gemini and OpenRouter. See the Tools Required section above for links to create accounts with these services.
  3. In Google Cloud Console, create a service account and enable the Google Drive API. Generate a JSON key file for this service account.
  4. In Google Drive, create an input folder for uploads and an output folder for CSV files. Share both folders with your service account email so it has access.
  5. In n8n, open the Google Drive Trigger node and set the folder ID to the input folder. Choose Service Account authentication and select or create your Google Service Account credential.
  6. In n8n Credentials, create a Google Service Account credential by uploading the JSON key. Use a clear name so you can reuse it on all Drive nodes.
  7. Create an OpenRouter API key in your OpenRouter account. In n8n Credentials, add an HTTP Header Auth credential with key Authorization and value Bearer your_api_key.
  8. Get a Google Gemini API key from Google AI Studio. In n8n Credentials, create a Google Gemini API credential and paste the key. Link this credential to the Google Gemini Chat Model node.
  9. In Google Cloud Console, enable Vertex AI. Grant your service account the needed Vertex roles. In the Vertex AI extract text node, set your project and region as required and make sure it is connected to the Gemini model node.
  10. Open the Upload to Google Drive nodes and set the output folder ID. Keep Service Account authentication selected so CSV files save to the right place.
  11. Test the PDF path: upload a sample bank statement PDF to the input folder. In n8n, check Executions and confirm a CSV appears in the output folder with the expected columns.
  12. Test the image path: upload a clear photo of a receipt. Confirm the CSV appears and the text is readable. If needed, adjust prompts in the HTTP Request or Vertex chain to refine column names.
  13. If you see permission errors, confirm the Drive folders are shared with the service account and that Vertex AI and Drive APIs are enabled. Re run a small test file and review node logs for details.

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 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.

Google Vertex AI

Sign up

Gemini 2.5 Flash Lite: $0.10 per 1M input tokens; $0.40 per 1M output tokens (supports image inputs)

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.