Automate invoice processing with Gmail, OCR.space, Slack & Xero
Ready for 3.0What this workflow does
This workflow has 20 nodes and runs on Gmail events. Along the way it connects Gmail, Google Sheets, Slack and Xero. It also calls api.ocr.space and api.xero.com over HTTP.
How it runs
Trigger: On Gmail events.
- Code: runs custom JavaScript code
- Has Valid Attachment? (If): checks a condition and branches into true / false
- Extract Text (HTTP Request): calls api.ocr.space (POST)
- Parse Invoice Data (Code): runs custom JavaScript code
- Check Qualification (If): checks a condition and branches into true / false
- Append or update row in sheet (Google Sheets): append or update
- Slack: uses Slack
- Format for Slack (Code): runs custom JavaScript code
- Clean Invoice Payload (Code): runs custom JavaScript code
- Slack: send and wait for a reply
…plus 9 more steps. See the full node list below.
Services it uses
HTTP calls to: api.ocr.space, api.xero.com
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Gmail Trigger).
Nodes used (8)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Code
n8n-nodes-base.code - Google Sheets
n8n-nodes-base.googleSheets - Slack
n8n-nodes-base.slack - If
n8n-nodes-base.if - Gmail
n8n-nodes-base.gmail - Xero
n8n-nodes-base.xero - HTTP Request
n8n-nodes-base.httpRequest
From the author
How It Works 1. Trigger: Watches for new emails in Gmail with PDF/image attachments. 2. OCR: Sends the attachment to OCR.space API to extract invoice text. 3. Parsing: Extracts key fields: - Vendor - Invoice number - Amount - Currency - Invoice date - Due…