- Connect Integrations:
- Google Sheets (OAuth2)
- Google Gemini (PaLM API Key) for parsing
- Deploy Webhook endpoint at:
/uploadDoc - Test with sample uploads (PDFs, images, CSVs).
- Map Fields β Ensure column mappings in the Invoice Data node.
| 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 |
- 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.
- 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.
| 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 |
| 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 |
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.