Check supplier invoices from Gmail using OpenAI, Google Sheets and Slack
Ready for 3.0What this workflow does
This AI workflow has 17 nodes and runs on Gmail events (plus 1 other trigger). Along the way it connects Gmail, OpenAI Chat Model, Google Sheets and Slack.
How it runs
Trigger: On Gmail events (plus 1 other trigger).
- Keep only PDF attachments (Filter): keeps only the items that match a condition
- Alert finance that it broke (Slack): uses Slack
- Read the PDF (Extract from File): extracts data from a file (pdf)
- Pull the invoice fields (Information Extractor): extracts structured fields from text with AI, with model: Extraction model
- Supplier master (Google Sheets): uses Google Sheets
- Open purchase orders (Google Sheets): uses Google Sheets
- Invoices already posted (Google Sheets): uses Google Sheets
- Run the checks (Code): runs custom JavaScript code
- Did every check pass? (If): checks a condition and branches into true / false
- Inside the approval limit? (If): checks a condition and branches into true / false
…plus 4 more steps. See the full node list below.
Services it uses
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) (Invoice arrives by email).
Nodes used (11)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Filter
n8n-nodes-base.filter - Extract from File
n8n-nodes-base.extractFromFile - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi - Information Extractor
@n8n/n8n-nodes-langchain.informationExtractor - Google Sheets
n8n-nodes-base.googleSheets - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Slack
n8n-nodes-base.slack - Gmail
n8n-nodes-base.gmail - Error Trigger
n8n-nodes-base.errorTrigger
From the author
Quick overview Watches a Gmail label for supplier invoice PDFs, reads the fields with OpenAI, then runs eight checks against supplier, purchase order and ledger data in Google Sheets. Clean invoices post to the ledger, large ones go to Slack for sign off, and…