What This Workflow Does
This workflow watches a specific Google Drive folder for new bank statement PDFs or images.
It downloads files and finds text inside PDFs or images.
Then it asks an AI model to turn the raw text into a clean CSV file that has transactions sorted by category.
The workflow saves time and reduces mistakes by making CSV files automatically from financial documents.
Who Should Use This Workflow
Anyone who needs to extract transaction data from bank statements or receipts in PDFs or images.
It is great for small businesses, accountants, or bookkeepers who want to stop doing manual copy-paste.
It fits users with Google Drive storage and who want automatic CSV exports for their accounting.
Tools and Services Used
- Google Drive API: Detect and download new files from a drive folder.
- n8n ExtractFromFile node: Pull text from PDFs.
- Google Vertex AI: Extract text from images via AI.
- Openrouter API: Use the Meta LLaMA 3.1 AI model to parse raw text and produce CSV.
- n8n ConvertToFile node: Turn AI text output into CSV files.
- Google Drive API: Upload concluded CSV files back to Drive.
Inputs, Processing Steps, and Output
Inputs
- New PDFs or image files placed into a specific Google Drive folder.
Processing Steps
- Trigger when a new file appears in the folder via Google Drive Trigger node.
- Use a Switch node to send PDFs and images down different paths.
- Download files using Google Drive nodes.
- Extract text with ExtractFromFile node for PDFs, or send images to Google Vertex AI node for text extraction.
- Send the extracted text to Openrouter AI via an HTTP Request node calling Meta LLaMA 3.1 to parse and convert text into categorized CSV format.
- Convert AI response text to CSV files using ConvertToFile nodes.
- Upload the CSV files back to Drive using Google Drive node.
Output
The user gets categorized transaction data as CSV files stored in Google Drive ready to import into accounting software.
Beginner Step-by-Step: How to Use This Workflow in n8n Production
Step 1: Import the Workflow
- Download the workflow file using the Download button on this page.
- Open the n8n editor where you want to use the automation.
- Click on “Import from File” and select the downloaded workflow file.
Step 2: Configure Credentials and IDs
- Go to each Google Drive node and connect your Google Service Account credentials.
- In the Google Drive Trigger node, update the folder ID to your target bank statement or receipt folder.
- Add your Openrouter API Key in the HTTP Request node settings for authorization.
- If needed, update any folder IDs or authentication emails used for uploads.
Step 3: Test the Workflow
- Upload a test PDF or image file to the Google Drive folder you are monitoring.
- Check if the workflow triggers and you get a CSV file uploaded back to the Drive output folder.
Step 4: Activate for Production
- Turn the workflow toggle ON to enable automatic runs on new files.
- Monitor executions the first few times to catch any errors.
- Adjust configuration or credentials if there are permission or API issues.
Use self-host n8n if more control over the runtime is needed.
Common Issues and Fixes
- Google Drive Trigger fires but files not processed: Make sure the folder is shared with your Google Service Account email.
- Empty text from ExtractFromFile node: Check if PDF has selectable text, not just scanned images.
- Vertex AI permission errors: Enable the Vertex AI API in Google Cloud and grant correct roles to your service account.
- Openrouter API 401 error: Verify the API key and HTTP header formats in the HTTP Request node.
Customization Ideas
- Switch AI models by changing the HTTP Request node to use GPT-4 or Google Gemini for parsing.
- Add other image file types in the Switch node by matching additional MIME types.
- Insert filters to remove old or small transactions before CSV conversion using a Function node.
- Change CSV filenames dynamically by adding client or bank names with expressions in the upload node.
- Add email notifications with a Gmail node after CSV uploads for alerts.
Summary of Benefits
✓ Saves time by automating data extraction from PDFs and images.
✓ Produces cleaner, structured CSV files with categorized expense columns.
✓ Reduces errors from manual copy-pasting and delays in reporting.
✓ Works fully integrated within Google Drive and n8n workflow.
→ Makes financial data ready for accounting software fast and easy.
