Back to Templates

Validate and process Gmail invoice PDFs with PDF Vector and Slack alerts

Created by

Created by: PDF Vector || pdfvector

PDF Vector

Last update

Last update 20 hours ago

Share


Who is this for

Finance teams and accounts payable departments who need automated invoice validation before processing. Perfect for catching calculation errors, missing fields, and discrepancies before they reach your accounting system.
image.png

What it does

Monitors Gmail for invoice attachments, extracts all data using AI, validates mathematical accuracy of line items and totals, then routes valid invoices to your database while flagging errors for manual review.

How it works

  • Gmail trigger watches for new emails with PDF attachments
  • PDF Vector extracts structured invoice data (vendor, amounts, line items, dates)
  • Validation checks: line item math (qty × price = amount), subtotal accuracy, and total calculation
  • Valid invoices logged to Google Sheets + Slack success message
  • Invalid invoices flagged separately + Slack error alert

Setup steps

  1. Connect Gmail OAuth2 credentials
  2. Get PDF Vector API key from pdfvector.com/api-keys
  3. Create Google Sheet with tabs: "Invoices" and "Flagged Invoices"
  4. Connect Slack and set notification channels
  5. Update Sheet ID in both Sheets nodes

Requirements

  • Gmail account (OAuth2)
  • PDF Vector API key (community node - self-hosted n8n only)
  • Google Sheets account (OAuth2)
  • Slack workspace with API access

Validation checks included

  • Line item math: quantity × unit price = line amount
  • Subtotal accuracy: sum of line items = stated subtotal
  • Total calculation: subtotal + tax = total
  • Required fields: invoice number, vendor name, total amount
  • Tolerance: ±$0.01 for rounding differences

Customization ideas

  • Adjust ±$0.01 tolerance in Validate invoice node
  • Add more required field checks
  • Connect to your ERP system
  • Swap Slack for Microsoft Teams