Extract & classify invoices & receipts with Gmail, OpenAI and Google Drive
Needs changesWhat this workflow does
This AI workflow has 18 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects OpenAI, Google Drive and Gmail.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Create folder (Google Drive): work with folder
- Configure (Edit Fields (Set)): sets or maps fields
- Respond to Webhook: sends the response back to the webhook caller
- Get emails with attachments (Gmail): get many
- Optional filter for emails (Filter): keeps only the items that match a condition
- Iterate over email attachments (Code): runs custom JavaScript code
- Is attachment a PDF? (If): checks a condition and branches into true / false
- Read PDF: uses Read PDF
- Is text within token limit? (If): checks a condition and branches into true / false
- OpenAI: uses OpenAI
…plus 6 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- Read PDF in Read PDF email attachments: replace with Extract from File node, 'Extract From PDF' operation.
| Removed in 3.0 | Replace with |
|---|---|
| Read PDF Read PDF email attachments | Extract from File node, 'Extract From PDF' operation |
Nodes used (12)
- OpenAI
@n8n/n8n-nodes-langchain.openAi - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - No Operation, do nothing
n8n-nodes-base.noOp - If
n8n-nodes-base.if - Merge
n8n-nodes-base.merge - Google Drive
n8n-nodes-base.googleDrive - Webhook
n8n-nodes-base.webhook - Respond to Webhook
n8n-nodes-base.respondToWebhook - Gmail
n8n-nodes-base.gmail - Read PDF
n8n-nodes-base.readPDF - Filter
n8n-nodes-base.filter
From the author
Who is it for? Anyone who wants to automatically aggregate their invoices or receipts. Main beneficiaries: small business owners and freelancers. How it works 1. Creates a folder in Google Drive for uploading invoices and receipts. Responds (Webhook response)…