Route scanned invoices by company

Scanned invoices matched to a company, then emailed. An n8n template that watches a Google Drive folder for scanned invoices and extracts their text with OCR.Space. An OpenAI AI Agent reads the 'billed to' company name and checks it against a Google Sheet that holds company names and recipient emails. On a match, the invoice is sent as an attachment to the recipient through Gmail; on no match or an error, an alert email goes to an operator for manual review.

n8nRead on 2026-11-165 steps

Steps

  1. Trigger: Watches a Google Drive folder for new invoicesGoogle Drive
  2. OCR Space extracts the textOCR.Space
  3. AI agent matches the company nameOpenAI
    Cross-referenced against a database in Google Sheets.
  4. Output: Sends the invoice to the matched recipientGmail
    As an attachment.
  5. Output: Emails an operator if there is no matchGmail
    For manual review.

Limits

  • If no company matches, an operator gets an email.

What it does well

  • Company names are checked against a sheet of recipient emails.

Before you import

You need: OCR.Space header credential named apikey, an OpenAI API key, Google Drive and an email service.

Similar templates