Skip to content

This n8n workflow automatically parses documents such as invoices, sensor logs or structured PDFs/images (including scanned docs or CSVs), extracts key fields like totals, dates and customer/vendor info using OCR and AI, and writes the structured output into Google Sheets.

License

Notifications You must be signed in to change notification settings

weblineindia/n8n-Parse-Invoices-Documents-with-Gemini-AI-OCR-and-Google-Sheets-Integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

n8n-Parse-Invoices-Documents-with-Gemini-AI-OCR-and-Google-Sheets-Integration

  1. Connect Integrations:
  • Google Sheets (OAuth2)
  • Google Gemini (PaLM API Key) for parsing
  1. Deploy Webhook endpoint at: /uploadDoc
  2. Test with sample uploads (PDFs, images, CSVs).
  3. Map Fields β†’ Ensure column mappings in the Invoice Data node.

βœ… Requirements

Tool Purpose
n8n Workflow automation framework
Google Sheets Store structured output
Tesseract OCR Extract text from scanned images
Google Gemini Natural language parsing & JSON output

🎨 How to Customize

  • Add extraction for line items using structured prompts.
  • Modify prompt for sensor readings, log events, or custom keys.
  • Extend support for XLSX or DOCX files.
  • Add Slack/Email notifications on success/failure.
  • Swap Gemini with OpenAI or Hugging Face models.

βž• Add-ons

  • Save uploaded files to Google Drive or AWS S3.
  • Add authentication for secure uploads.
  • Use charting/dashboard nodes to visualize extracted data.
  • Integrate with billing/accounting software.

πŸ“Œ Use Case Examples

Scenario What Happens
Invoice Upload (PDF) Extracts totals, customer, tax data into Sheets
Scanned Receipt (Image) OCR + LLM extracts structured values
Log File (CSV) Parses and logs entries into Google Sheets

πŸ› οΈ Common Troubleshooting

Issue Possible Cause Solution
Webhook not triggered Wrong URL or method Use correct POST /uploadDoc endpoint
Text is blank OCR failed Check image quality or Tesseract config
Gemini not returning JSON Prompt formatting issue Ensure prompt ends with valid JSON schema
Sheet not updated Wrong Sheet ID or tab name Double-check credentials & sheet details

🀝 Need Help?

Want to:

  • Fine-tune Gemini prompts for better accuracy?
  • Extract full tables or multi-page invoices?
  • Convert PDFs to JSON lines for advanced workflows?

πŸ‘‰ The automation team at WeblineIndia can help you extend this into a full document automation pipeline.


About

This n8n workflow automatically parses documents such as invoices, sensor logs or structured PDFs/images (including scanned docs or CSVs), extracts key fields like totals, dates and customer/vendor info using OCR and AI, and writes the structured output into Google Sheets.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published