Automatic Monitoring and AI-Powered Data Extraction from Google Drive PDFs
Welcome to the world of automation, where “Backrun” empowers businesses by streamlining backend operations. From lead generation to support, we help you focus on growth, not grunt work. Today, we will delve into the incredible functionalities of automatic monitoring of a Google Drive folder for new PDF files, complemented by AI-powered data extraction for invoices.
Monitoring
Our system utilizes the Google Drive Trigger to monitor a defined input folder, ensuring that:
- It automatically starts when new PDF files are detected.
- Files are processed in batches, enabling efficiency and speed.
File Processing
Once files are detected, the system performs streamlined file processing:
- GetFile downloads PDF files from Google Drive.
- ExtractFromPDF converts PDF content into text.
- This process supports scanned documents as well, ensuring inclusivity.

AI Data Extraction
The turbocharged part of the automation is the AI data extraction powered by the Google Gemini API. Key information extracted includes:
- Company name/sender
- Customer name and customer number
- Invoice number and date
- Net and gross amounts
- Value-added tax
- Article description
- Month and year for sorting
Automatic Filing
Once data is extracted, automatic filing takes place:
- GetYearFolder searches or creates year folders.
- GetMonthFolder searches or creates month folders.
- MoveFile moves the invoice to the correct folder.
- UpdateFileName renames the file with a schema like “Customer Month Year.”
Documentation
All the data is entered into a Google Sheets table using AddToOverview, enabling a central overview and analysis:
- Customer Number
- Customer
- [Company Name] Location
- Invoice Date
- Invoice Number
- VAT
- Net Amount
- Month
- Year
Setup Guide
To get started, follow these steps:
- Select your input folder as “Folder to Watch.”
- Set the “Event” to “fileCreated.”
- Activate the trigger and select the same input folder as filter.
- Adapt attribute names to your needs.
- Change the company name in descriptions and adjust the system prompt if needed.
- Set the correct folder ID for your main folder and verify the query string for year/month search.
- Select your Google Sheets table and map columns accordingly.
Permissions and Formats
Ensure you have the right permissions for smooth operation:
- Google Drive: Full access to configured folders.
- Google Sheets: Write permission for the target table.
- Google Gemini: Valid API key required.
Our system supports various PDF formats and is particularly adept at handling German number formats (comma as decimal separator), with a date format of YYYY-MM-DD.
Workflow Testing
Before full deployment, conduct a workflow test:
- Upload a test PDF to the input folder.
- Monitor workflow execution in n8n.
- Check results in Google Sheets to verify file movement and renaming.
Error Diagnosis
In case of issues:
- Check n8n logs for errors.
- Be mindful of Google API quotas.
- Validate folder permissions.
With an AI accuracy of roughly 95% for standardized invoices and a processing time of 30-60 seconds per invoice, this intelligent invoice processing solution is efficient and reliable.
For more insights into how to scale your automation capabilities, feel free to explore our offerings on AI-powered solutions or Microsoft 365 Copilot.
Ready to take your efficiency to the next level? Visit us at Backrun or contact us at hello@backrun.us.