Automate Invoice Processing with Gmail, OCR.space, Slack & Xero — n8n Workflow
Overview
How It Works
Trigger: Watches for new emails in Gmail with PDF/image attachments.
OCR: Sends the attachment to OCR.space API (https://ocr.space/OCRAPI) to extract invoice text.
Parsing: Extracts key fields:
Vendor
Invoice number
Amount
Currency
Invoice date
Due date
Description
Validation Logic:
Checks if amount is valid
Ensures vendor and invoice number are present
Flags high-value invoices (e.g., over $10,000)
Routing:
If invalid:
Nodes used
Workflow Preview
How it Works
- 1
Trigger
The workflow starts with a trigger trigger.
- 2
Process
Data flows through 20 nodes, connecting code, gmail, gmailtrigger.
- 3
Output
The workflow completes its automation and delivers the result to the configured destination.
Node Details (20)
Google Sheets
googleSheets
HTTP Request
httpRequest
Slack
slack
Xero
xero
Gmail
gmail
Code
code
How to Import This Workflow
- 1Click Download JSON button on the right to save the workflow file.
- 2Open your n8n instance. Go to Workflows → New → Import from file.
- 3Select the downloaded
automate-invoice-processing-with-gmail-ocrspace-slack-xerofile and click Import. - 4Set up credentials for each service node (API keys, OAuth, etc.).
- 5Click Test Workflow to verify everything works, then activate it.
Or paste directly in n8n → Import from JSON:
Integrations
Created by
Abi Odedeyi
@abiodedeyi
Tags
New to n8n?
n8n is a free, open-source workflow automation tool. Self-host it or use the cloud version.
Get n8n Free →