Extract and validate Gmail invoice PDFs into Google Sheets with OpenAI
n8n-workflow-18603.n8n.io
· n8n.io
Quick overview This workflow watches a Gmail label for invoice emails with PDF attachments, extracts the PDF text, uses OpenAI to pull structured invoice fields, validates totals and VAT logic, and then appends clean invoices to an Invoices tab in Google Sheets while routing failures to an Exceptions tab. How it works 1. Triggers every minute when a new Gmail message arrives under a specified label and has attachments, downloading the attachments for processing. 2. Filters the message to keep only PDF attachments. 3. Converts the PDF attachment into plain text. 4. Sends the extracted text to OpenAI to extract structured invoice data (supplier, invoice number, dates, currency, totals, VAT, and line items) using a strict schema. 5. Validates the extracted values by checking required fields, total reconciliation (net + VAT ≈ gross), line-item sums, allowed VAT rates, and flags negative totals. 6. Appends validated invoices to the Invoices sheet in Google Sheets and sends any non-reconcili
n8n-workflow-18603.n8n.io via a single DNS TXT record to add the
verified by owner badge, embed an Agenstry badge on your README, and earn back the missing conformance points listed below.
Dispute or improve this rating
F
Conformance score: 19/100
F-grade: card is reachable but fails most operational signals.
click to expand breakdown ▾
click to collapse breakdown ▴
agent-card.json changed within the last 7 days. We track these so downstream callers can react.
Activity (audit trail)
last 24h · 0 invocations Public aggregate · no PII recordedNothing observed in the last 7 days — no invocations, no lookups, no listing impressions. Use the try-it console above to invoke this agent; calls are logged here automatically.
Endpoints
| Agent card | https://n8n.io/workflows/18603 |
| Provider | https://n8n.io |
| Docs | https://n8n.io/workflows/18603 |
Health · last 0 probes
Similar agents embedding-nearest
Embed your Agenstry badge
Paste any of these into your README, agent card, or marketing page. Each badge auto-updates and links back to this page.
Markdown / HTML snippets
[](https://agenstry.com/agents/n8n-workflow-18603.n8n.io) [](https://agenstry.com/agents/n8n-workflow-18603.n8n.io) [](https://agenstry.com/agents/n8n-workflow-18603.n8n.io) [](https://agenstry.com/agents/n8n-workflow-18603.n8n.io)
Audit-grade evidence bundle
JSON snapshot for vendor-review files. Add ?sign=true for a JWS-signed envelope verifiable against
our JWKS. See the methodology.
Raw agent card JSON
{
"_source": "n8n.io",
"workflow": {
"id": 18603,
"name": "Extract and validate Gmail invoice PDFs into Google Sheets with OpenAI",
"totalViews": 25,
"price": null,
"purchaseUrl": null,
"recentViews": 50,
"createdAt": "2026-08-23T13:22:05.209Z",
"user": {
"username": "fractional-hq",
"verified": true
},
"readyToDemo": null,
"nodes": [
{
"id": 18,
"icon": "file:googleSheets.svg",
"name": "n8n-nodes-base.googleSheets",
"codex": {
"data": {
"alias": [
"CSV",
"Sheet",
"Spreadsheet",
"GS"
],
"resources": {
"generic": [
{
"url": "https://n8n.io/blog/love-at-first-sight-ricardos-n8n-journey/",
"icon": "\u2764\ufe0f",
"label": "Love at first sight: Ricardo\u2019s n8n journey"
},
{
"url": "https://n8n.io/blog/why-business-process-automation-with-n8n-can-change-your-daily-life/",
"icon": "\ud83e\uddec",
"label": "Why business process automation with n8n can change your daily life"
},
{
"url": "https://n8n.io/blog/automatically-adding-expense-receipts-to-google-sheets-with-telegram-mindee-twilio-and-n8n/",
"icon": "\ud83e\uddfe",
"label": "Automatically Adding Expense Receipts to Google Sheets with Telegram, Mindee, Twilio, and n8n"
},
{
"url": "https://n8n.io/blog/supercharging-your-conference-registration-process-with-n8n/",
"icon": "\ud83c\udfab",
"label": "Supercharging your conference registration process with n8n"
},
{
"url": "https://n8n.io/blog/creating-triggers-for-n8n-workflows-using-polling/",
"icon": "\u23f2",
"label": "Creating triggers for n8n workflows using polling"
},
{
"url": "https://n8n.io/blog/no-code-ecommerce-workflow-automations/",
"icon": "store",
"label": "6 e-commerce workflows to power up your Shopify s"
},
{
"url": "https://n8n.io/blog/migrating-community-metrics-to-orbit-using-n8n/",
"icon": "\ud83d\udcc8",
"label": "Migrating Community Metrics to Orbit using n8n"
},
{
"url": "https://n8n.io/blog/automate-google-apps-for-productivity/",
"icon": "\ud83d\udca1",
"label": "15 Google apps you can combine and automate to increase productivity"
},
{
"url": "https://n8n.io/blog/your-business-doesnt-need-you-to-operate/",
"icon": " \ud83d\udda5\ufe0f",
"label": "Hey founders! Your business doesn't need you to operate"
},
{
"url": "https://n8n.io/blog/how-honest-burgers-use-automation-to-save-100k-per-year/",
"icon": "\ud83c\udf54",
"label": "How Honest Burgers Use Automation to Save $100k per year"
},
{
"url": "https://n8n.io/blog/how-a-digital-strategist-uses-n8n-for-online-marketing/",
"icon": "\ud83d\udcbb",
"label": "How a digital strategist uses n8n for online marketing"
},
{
"url": "https://n8n.io/blog/why-this-product-manager-loves-workflow-automation-with-n8n/",
"icon": "\ud83e\udde0",
"label": "Why this Product Manager loves workflow automation with n8n"
},
{
"url": "https://n8n.io/blog/sending-automated-congratulations-with-google-sheets-twilio-and-n8n/",
"icon": "\ud83d\ude4c",
"label": "Sending Automated Congratulations with Google Sheets, Twilio, and n8n "
},
{
"url": "https://n8n.io/blog/how-a-membership-development-manager-automates-his-work-and-investments/",
"icon": "\ud83d\udcc8",
"label": "How a Membership Development Manager automates his work and investments"
},
{
"url": "https://n8n.io/blog/aws-workflow-automation/",
"label": "7 no-code workflow automations for Amazon Web Services"
}
],
"primaryDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googlesheets/"
}
],
"credentialDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/credentials/google/oauth-single-service/"
}
]
},
"categories": [
"Data & Storage",
"Productivity"
],
"nodeVersion": "1.0",
"codexVersion": "1.0"
}
},
"group": "[\"input\",\"output\"]",
"defaults": {
"name": "Google Sheets"
},
"iconData": {
"type": "file",
"fileBuffer": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2MCIgaGVpZ2h0PSI2MCI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGZpbGw9IiMyOEI0NDYiIGQ9Ik0zNS42OSAxIDUyIDE3LjIyNXYzOS4wODdhMy42N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AzLjcgMCAwIDEtMi42MjMtMS4wNzhBMy42NyAzLjY3IDAgMCAxIDggNTUuMzEyVjMuNjg4YTMuNjcgMy42NyAwIDAgMSAxLjA4NC0yLjYxQTMuNyAzLjcgMCAwIDEgMTEuNzA3IDB6Ii8+PHBhdGggZmlsbD0iIzZBQ0U3QyIgZD0iTTM0LjY5IDAgNTEgMTYuMjI1SDM4LjM5N2MtMi4wNTQgMC0zLjcwNy0xLjgyOS0zLjcwNy0zLjg3MnoiLz48cGF0aCBmaWxsPSIjMjE5QjM4IiBkPSJNMzguMjExIDE2LjIyNSA1MSAyMS40OHYtNS4yNTV6Ii8+PHBhdGggZmlsbD0iI0ZGRiIgZD0iTTE5LjEyIDMwLjk3NWMwLS44MTcuNjYyLTEuNDc1IDEuNDgzLTEuNDc1aDE3Ljc5NGMuODIxIDAgMS40ODIuNjU4IDEuNDgyIDEuNDc1djE1LjQ4N2MwIC44MTgtLjY2MSAxLjQ3NS0xLjQ4MiAxLjQ3NUgyMC42MDNhMS40NzYgMS40NzYgMCAwIDEtMS40ODItMS40NzRWMzAuOTc0em0yLjIyNSAxLjQ3NWg2LjY3MnYyLjIxMmgtNi42NzJ6bTAgNS4xNjJoNi42NzJ2Mi4yMTNoLTYuNjcyem0wIDUuMTYzaDYuNjcydjIuMjEyaC02LjY3MnptOS42MzgtMTAuMzI1aDYuNjcydjIuMjEyaC02LjY3MnptMCA1LjE2Mmg2LjY3MnYyLjIxM2gtNi42NzJ6bTAgNS4xNjNoNi42NzJ2Mi4yMTJoLTYuNjcyeiIvPjwvZz48L3N2Zz4="
},
"displayName": "Google Sheets",
"typeVersion": 5,
"nodeCategories": [
{
"id": 3,
"name": "Data & Storage"
},
{
"id": 4,
"name": "Productivity"
}
]
},
{
"id": 20,
"icon": "fa:map-signs",
"name": "n8n-nodes-base.if",
"codex": {
"data": {
"alias": [
"Router",
"Filter",
"Condition",
"Logic",
"Boolean",
"Branch"
],
"details": "The IF node can be used to implement binary conditional logic in your workflow. You can set up one-to-many conditions to evaluate each item of data being inputted into the node. That data will either evaluate to TRUE or FALSE and route out of the node accordingly.\n\nThis node has multiple types of conditions: Bool, String, Number, and Date & Time.",
"resources": {
"generic": [
{
"url": "https://n8n.io/blog/learn-to-automate-your-factorys-incident-reporting-a-step-by-step-guide/",
"icon": "\ud83c\udfed",
"label": "Learn to Automate Your Factory's Incident Reporting: A Step by Step Guide"
},
{
"url": "https://n8n.io/blog/2021-the-year-to-automate-the-new-you-with-n8n/",
"icon": "\u2600\ufe0f",
"label": "2021: The Year to Automate the New You with n8n"
},
{
"url": "https://n8n.io/blog/why-business-process-automation-with-n8n-can-change-your-daily-life/",
"icon": "\ud83e\uddec",
"label": "Why business process automation with n8n can change your daily life"
},
{
"url": "https://n8n.io/blog/create-a-toxic-language-detector-for-telegram/",
"icon": "\ud83e\udd2c",
"label": "Create a toxic language detector for Telegram in 4 step"
},
{
"url": "https://n8n.io/blog/no-code-ecommerce-workflow-automations/",
"icon": "store",
"label": "6 e-commerce workflows to power up your Shopify s"
},
{
"url": "https://n8n.io/blog/how-to-build-a-low-code-self-hosted-url-shortener/",
"icon": "\ud83d\udd17",
"label": "How to build a low-code, self-hosted URL shortener in 3 steps"
},
{
"url": "https://n8n.io/blog/automate-your-data-processing-pipeline-in-9-steps-with-n8n/",
"icon": "\u2699\ufe0f",
"label": "Automate your data processing pipeline in 9 steps"
},
{
"url": "https://n8n.io/blog/how-to-get-started-with-crm-automation-and-no-code-workflow-ideas/",
"icon": "\ud83d\udc65",
"label": "How to get started with CRM automation (with 3 no-code workflow ideas"
},
{
"url": "https://n8n.io/blog/5-tasks-you-can-automate-with-notion-api/",
"icon": "\u26a1\ufe0f",
"label": "5 tasks you can automate with the new Notion API "
},
{
"url": "https://n8n.io/blog/automate-google-apps-for-productivity/",
"icon": "\ud83d\udca1",
"label": "15 Google apps you can combine and automate to increase productivity"
},
{
"url": "https://n8n.io/blog/automation-for-maintainers-of-open-source-projects/",
"icon": "\ud83c\udff7\ufe0f",
"label": "How to automatically manage contributions to open-source projects"
},
{
"url": "https://n8n.io/blog/how-uproc-scraped-a-multi-page-website-with-a-low-code-workflow/",
"icon": " \ud83d\udd78\ufe0f",
"label": "How uProc scraped a multi-page website with a low-code workflow"
},
{
"url": "https://n8n.io/blog/5-workflow-automations-for-mattermost-that-we-love-at-n8n/",
"icon": "\ud83e\udd16",
"label": "5 workflow automations for Mattermost that we love at n8n"
},
{
"url": "https://n8n.io/blog/why-this-product-manager-loves-workflow-automation-with-n8n/",
"icon": "\ud83e\udde0",
"label": "Why this Product Manager loves workflow automation with n8n"
},
{
"url": "https://n8n.io/blog/sending-automated-congratulations-with-google-sheets-twilio-and-n8n/",
"icon": "\ud83d\ude4c",
"label": "Sending Automated Congratulations with Google Sheets, Twilio, and n8n "
},
{
"url": "https://n8n.io/blog/how-to-set-up-a-ci-cd-pipeline-with-no-code/",
"icon": "\ud83c\udfa1",
"label": "How to set up a no-code CI/CD pipeline with GitHub and TravisCI"
},
{
"url": "https://n8n.io/blog/benefits-of-automation-and-n8n-an-interview-with-hubspots-hugh-durkin/",
"icon": "\ud83c\udf96",
"label": "Benefits of automation and n8n: An interview with HubSpot's Hugh Durkin"
},
{
"url": "https://n8n.io/blog/aws-workflow-automation/",
"label": "7 no-code workflow automations for Amazon Web Services"
}
],
"primaryDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.if/"
}
]
},
"categories": [
"Core Nodes"
],
"nodeVersion": "1.0",
"codexVersion": "1.0",
"subcategories": {
"Core Nodes": [
"Flow"
]
}
}
},
"group": "[\"transform\"]",
"defaults": {
"name": "If",
"color": "#408000"
},
"iconData": {
"icon": "map-signs",
"type": "icon"
},
"displayName": "If",
"typeVersion": 2,
"nodeCategories": [
{
"id": 9,
"name": "Core Nodes"
}
]
},
{
"id": 565,
"icon": "fa:sticky-note",
"name": "n8n-nodes-base.stickyNote",
"codex": {
"data": {
"alias": [
"Comments",
"Notes",
"Sticky"
],
"categories": [
"Core Nodes"
],
"nodeVersion": "1.0",
"codexVersion": "1.0",
"subcategories": {
"Core Nodes": [
"Helpers"
]
}
}
},
"group": "[\"input\"]",
"defaults": {
"name": "Sticky Note",
"color": "#FFD233"
},
"iconData": {
"icon": "sticky-note",
"type": "icon"
},
"displayName": "Sticky Note",
"typeVersion": 1,
"nodeCategories": [
{
"id": 9,
"name": "Core Nodes"
}
]
},
{
"id": 824,
"icon": "file:gmail.svg",
"name": "n8n-nodes-base.gmailTrigger",
"codex": {
"data": {
"resources": {
"generic": [
{
"url": "https://n8n.io/blog/why-business-process-automation-with-n8n-can-change-your-daily-life/",
"icon": "\ud83e\uddec",
"label": "Why business process automation with n8n can change your daily life"
},
{
"url": "https://n8n.io/blog/supercharging-your-conference-registration-process-with-n8n/",
"icon": "\ud83c\udfab",
"label": "Supercharging your conference registration process with n8n"
},
{
"url": "https://n8n.io/blog/no-code-ecommerce-workflow-automations/",
"icon": "store",
"label": "6 e-commerce workflows to power up your Shopify s"
},
{
"url": "https://n8n.io/blog/how-to-get-started-with-crm-automation-and-no-code-workflow-ideas/",
"icon": "\ud83d\udc65",
"label": "How to get started with CRM automation (with 3 no-code workflow ideas"
},
{
"url": "https://n8n.io/blog/automate-google-apps-for-productivity/",
"icon": "\ud83d\udca1",
"label": "15 Google apps you can combine and automate to increase productivity"
},
{
"url": "https://n8n.io/blog/your-business-doesnt-need-you-to-operate/",
"icon": " \ud83d\udda5\ufe0f",
"label": "Hey founders! Your business doesn't need you to operate"
},
{
"url": "https://n8n.io/blog/using-automation-to-boost-productivity-in-the-workplace/",
"icon": "\ud83d\udcaa",
"label": "Using Automation to Boost Productivity in the Workplace"
}
],
"primaryDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.gmailtrigger/"
}
],
"credentialDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/credentials/google/oauth-single-service/"
}
]
},
"categories": [
"Communication"
],
"nodeVersion": "1.0",
"codexVersion": "1.0"
}
},
"group": "[\"trigger\"]",
"defaults": {
"name": "Gmail Trigger"
},
"iconData": {
"type": "file",
"fileBuffer": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTYiIGhlaWdodD0iMTkzIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCI+PHBhdGggZmlsbD0iIzQyODVGNCIgZD0iTTU4LjE4MiAxOTIuMDVWOTMuMTRMMjcuNTA3IDY1LjA3NyAwIDQ5LjUwNHYxMjUuMDkxYzAgOS42NTggNy44MjUgMTcuNDU1IDE3LjQ1NSAxNy40NTV6Ii8+PHBhdGggZmlsbD0iIzM0QTg1MyIgZD0iTTE5Ny44MTggMTkyLjA1aDQwLjcyN2M5LjY1OSAwIDE3LjQ1NS03LjgyNiAxNy40NTUtMTcuNDU1VjQ5LjUwNWwtMzEuMTU2IDE3LjgzNy0yNy4wMjYgMjUuNzk4eiIvPjxwYXRoIGZpbGw9IiNFQTQzMzUiIGQ9Im01OC4xODIgOTMuMTQtNC4xNzQtMzguNjQ3IDQuMTc0LTM2Ljk4OUwxMjggNjkuODY4bDY5LjgxOC01Mi4zNjQgNC42NyAzNC45OTItNC42NyA0MC42NDRMMTI4IDE0NS41MDR6Ii8+PHBhdGggZmlsbD0iI0ZCQkMwNCIgZD0iTTE5Ny44MTggMTcuNTA0VjkzLjE0TDI1NiA0OS41MDRWMjYuMjMxYzAtMjEuNTg1LTI0LjY0LTMzLjg5LTQxLjg5LTIwLjk0NXoiLz48cGF0aCBmaWxsPSIjQzUyMjFGIiBkPSJtMCA0OS41MDQgMjYuNzU5IDIwLjA3TDU4LjE4MiA5My4xNFYxNy41MDRMNDEuODkgNS4yODZDMjQuNjEtNy42NiAwIDQuNjQ2IDAgMjYuMjN6Ii8+PC9zdmc+"
},
"displayName": "Gmail Trigger",
"typeVersion": 1,
"nodeCategories": [
{
"id": 6,
"name": "Communication"
}
]
},
{
"id": 834,
"icon": "file:code.svg",
"name": "n8n-nodes-base.code",
"codex": {
"data": {
"alias": [
"cpde",
"Javascript",
"JS",
"Python",
"Script",
"Custom Code",
"Function"
],
"details": "The Code node allows you to execute JavaScript in your workflow.",
"resources": {
"primaryDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.code/"
}
]
},
"categories": [
"Development",
"Core Nodes"
],
"nodeVersion": "1.0",
"codexVersion": "1.0",
"subcategories": {
"Core Nodes": [
"Helpers",
"Data Transformation"
]
}
}
},
"group": "[\"transform\"]",
"defaults": {
"name": "Code"
},
"iconData": {
"type": "file",
"fileBuffer": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMF8xMTcxXzQ0MSkiPgo8cGF0aCBkPSJNMTcwLjI4MyA0OEgxOTYuNUMyMDMuMTI3IDQ4IDIwOC41IDQyLjYyNzQgMjA4LjUgMzZWMTJDMjA4LjUgNS4zNzI1OCAyMDMuMTI3IDAgMTk2LjUgMEgxNzAuMjgzQzEyNi4xIDAgOTAuMjgzIDM1LjgxNzIgOTAuMjgzIDgwVjE3NkM5MC4yODMgMjA2LjkyOCA2NS4yMTA5IDIzMiAzNC4yODMgMjMySDIzQzE2LjM3MjYgMjMyIDExIDIzNy4zNzIgMTEgMjQ0VjI2OEMxMSAyNzQuNjI3IDE2LjM3MjQgMjgwIDIyLjk5OTYgMjgwTDM0LjI4MyAyODBDNjUuMjEwOSAyODAgOTAuMjgzIDMwNS4wNzIgOTAuMjgzIDMzNlY0NDBDOTAuMjgzIDQ3OS43NjQgMTIyLjUxOCA1MTIgMTYyLjI4MyA1MTJIMTk2LjVDMjAzLjEyNyA1MTIgMjA4LjUgNTA2LjYy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IgMjY4VjI0NEM1MDIgMjM3LjM3MyA0OTYuNjI4IDIzMiA0OTAgMjMyTDQ3OC45NzkgMjMyQzQ0OC4wNTEgMjMyIDQyMi45NzggMjA2LjkyOCA0MjIuOTc4IDE3NlY4MEM0MjIuOTc4IDM1LjgxNzIgMzg3LjE2MSAwIDM0Mi45NzkgMEgzMTdDMzEwLjM3MyAwIDMwNSA1LjM3MjU4IDMwNSAxMlYzNloiIGZpbGw9IiNGRjk5MjIiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8xMTcxXzQ0MSI+CjxyZWN0IHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSJ3aGl0ZSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo="
},
"displayName": "Code",
"typeVersion": 2,
"nodeCategories": [
{
"id": 5,
"name": "Development"
},
{
"id": 9,
"name": "Core Nodes"
}
]
},
{
"id": 844,
"icon": "fa:filter",
"name": "n8n-nodes-base.filter",
"codex": {
"data": {
"alias": [
"Router",
"Filter",
"Condition",
"Logic",
"Boolean",
"Branch"
],
"details": "The Filter node can be used to filter items based on a condition. If the condition is met, the item will be passed on to the next node. If the condition is not met, the item will be omitted. Conditions can be combined together by AND(meet all conditions), or OR(meet at least one condition).",
"resources": {
"generic": [],
"primaryDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.filter/"
}
]
},
"categories": [
"Core Nodes"
],
"nodeVersion": "1.0",
"codexVersion": "1.0",
"subcategories": {
"Core Nodes": [
"Flow",
"Data Transformation"
]
}
}
},
"group": "[\"transform\"]",
"defaults": {
"name": "Filter",
"color": "#229eff"
},
"iconData": {
"icon": "filter",
"type": "icon"
},
"displayName": "Filter",
"typeVersion": 2,
"nodeCategories": [
{
"id": 9,
"name": "Core Nodes"
}
]
},
{
"id": 1153,
"icon": "file:openAiLight.svg",
"name": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"codex": {
"data": {
"resources": {
"primaryDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatopenai/"
}
]
},
"categories": [
"AI",
"Langchain"
],
"subcategories": {
"AI": [
"Language Models",
"Root Nodes"
],
"Language Models": [
"Chat Models (Recommended)"
]
}
}
},
"group": "[\"transform\"]",
"defaults": {
"name": "OpenAI Chat Model"
},
"iconData": {
"type": "file",
"fileBuffer": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTM2Ljg2NzEgMTYuMzcxOEMzNy43NzQ2IDEzLjY0OCAzNy40NjIxIDEwLjY2NDIgMzYuMDEwOCA4LjE4NjYxQzMzLjgyODIgNC4zODY1MyAyOS40NDA3IDIuNDMxNDkgMjUuMTU1NiAzLjM1MTUxQzIzLjI0OTMgMS4yMDM5NiAyMC41MTA1IC0wLjAxNzMxNDggMTcuNjM5MiAwLjAwMDE4NTUzM0MxMy4yNTkxIC0wLjAwOTgxNDY4IDkuMzcyNzMgMi44MTAyNSA4LjAyNTIgNi45Nzc4M0M1LjIxMTM5IDcuNTU0MSAyLjc4MjU4IDkuMzE1MzggMS4zNjEzIDExLjgxMTdDLTAuODM3NDkzIDE1LjYwMTggLTAuMzM2MjMyIDIwLjM3OTQgMi42MDEzMyAyMy42Mjk0QzEuNjkzODEgMjYuMzUzMiAyLjAwNjMyIDI5LjMzNzEgMy40NTc2IDMxLjgxNDZDNS42NDAxNSAzNS42MTQ3IDEwLjAyNzcgMzcuNTY5NyAxNC4zMTI4IDM2LjY0OTdDMTYuMjE3OSAzOC43OTczIDE4Ljk1NzkgNDAuMDE4NSAyMS44MjkyIDM5Ljk5OThDMjYuMjExOCA0MC4wMTEgMzAuMDk5NCAzNy4xODg1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jY3NDUgNS45MTQwNiAzMy43NDIgOS41MDE2NEMzNC42MTU4IDExLjAxNjcgMzQuOTMyIDEyLjc5MDUgMzQuNjM1OCAxNC41MTQySDM0LjYzODNaTTEzLjU3NDEgMjEuNDQzMUwxMC4yMDY1IDE5LjQ5OTRDMTAuMTcwMiAxOS40ODE5IDEwLjE0NjUgMTkuNDQ2OCAxMC4xNDE1IDE5LjQwNjhWMTAuMTA3OUMxMC4xNDQgNS45Njc4MSAxMy41MDI4IDIuNjEyNzQgMTcuNjQyOSAyLjYxNTI0QzE5LjM5NDIgMi42MTUyNCAyMS4wODkyIDMuMjMwMjUgMjIuNDM1NSA0LjM1MDI4QzIyLjM3NDMgNC4zODI3OCAyMi4yNjkzIDQuNDQxNTMgMjIuMTk5MiA0LjQ4NDAzTDE0LjIzNDEgOS4wODQxM0MxMy44MjY2IDkuMzE1MzggMTMuNTc2NiA5Ljc0Nzg5IDEzLjU3OTEgMTAuMjE2N0wxMy41NzQxIDIxLjQ0MDZWMjEuNDQzMVpNMTUuNDAyOSAxNy41MDA2TDE5LjczNDIgMTQuOTk5M0wyNC4wNjU1IDE3LjQ5OTNWMjIuNTAwN0wxOS43MzQyIDI1LjAwMDdMMTUuNDAyOSAyMi41MDA3VjE3LjUwMDZaIiBmaWxsPSIjN0Q3RDg3Ii8+Cjwvc3ZnPgo="
},
"displayName": "OpenAI Chat Model",
"typeVersion": 1,
"nodeCategories": [
{
"id": 25,
"name": "AI"
},
{
"id": 26,
"name": "Langchain"
}
]
},
{
"id": 1235,
"icon": "file:extractFromFile.svg",
"name": "n8n-nodes-base.extractFromFile",
"codex": {
"data": {
"alias": [
"CSV",
"Spreadsheet",
"Excel",
"xls",
"xlsx",
"ods",
"tabular",
"decode",
"decoding",
"Move Binary Data",
"Binary",
"File",
"PDF",
"JSON",
"HTML",
"ICS",
"iCal",
"txt",
"Text",
"RTF",
"XML",
"64",
"Base64",
"Convert"
],
"resources": {
"primaryDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.extractfromfile/"
}
]
},
"categories": [
"Core Nodes"
],
"nodeVersion": "1.0",
"codexVersion": "1.0",
"subcategories": {
"Core Nodes": [
"Files",
"Data Transformation"
]
}
}
},
"group": "[\"input\"]",
"defaults": {
"name": "Extract from File"
},
"iconData": {
"type": "file",
"fileBuffer": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAuOTM3NSAyQzAuNDE5NzMzIDIgMCAyLjQxOTczIDAgMi45Mzc1VjM3LjMyMjFDMCAzNy44Mzk5IDAuNDE5NzMzIDM4LjI1OTYgMC45Mzc1IDM4LjI1OTZIMjYuMjE1NEMyNi43MzMyIDM4LjI1OTYgMjcuMTUyOSAzNy44Mzk5IDI3LjE1MjkgMzcuMzIyMUwyNy4xNTI5IDMwLjY3MTlMMTYuNzk2OSAzMC42NzE5QzE0Ljg5ODQgMzAuNjcxOSAxMy4zNTk0IDI5LjEzMjkgMTMuMzU5NCAyNy4yMzQ0VjI1LjM1OTRDMTMuMzU5NCAyMy40NjA5IDE0Ljg5ODQgMjEuOTIxOSAxNi43OTY5IDIxLjkyMTlIMjcuMTUyOUwyNy4xNTI5IDE1Ljc4MjFIMTQuMzA4M0MxMy43OTA2IDE1Ljc4MjEgMTMuMzcwOCAxNS4zNjI0IDEzLjM3MDggMTQuODQ0NlYySDAuOTM3NVoiIGZpbGw9IiMzNTNGNkUiLz4KPHBhdGggZD0iTTE2LjAyNzEgMkMxNS45NDA4IDIgMTUuODcwOCAyLjA2OTk2IDE1Ljg3MDggMi4xNTYyNVYxMi44MTM0QzE1Ljg3MDggMTMuMDcyMyAxNi4wODA3IDEzLjI4MjEgMTYuMzM5NiAxMy4yODIxSDI2Ljk5NjdDMjcuMDgzIDEzL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odes-langchain.informationExtractor",
"codex": {
"data": {
"alias": [
"NER",
"parse",
"parsing",
"JSON",
"data extraction",
"structured"
],
"resources": {
"primaryDocumentation": [
{
"url": "https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.information-extractor/"
}
]
},
"categories": [
"AI",
"Langchain"
],
"subcategories": {
"AI": [
"Chains",
"Root Nodes"
]
}
}
},
"group": "[\"transform\"]",
"defaults": {
"name": "Information Extractor"
},
"iconData": {
"icon": "project-diagram",
"type": "icon"
},
"displayName": "Information Extractor",
"typeVersion": 1,
"nodeCategories": [
{
"id": 25,
"name": "AI"
},
{
"id": 26,
"name": "Langchain"
}
]
}
]
},
"detail": {
"description": "Quick overview This workflow watches a Gmail label for invoice emails with PDF attachments, extracts the PDF text, uses OpenAI to pull structured invoice fields, validates totals and VAT logic, and then appends clean invoices to an Invoices tab in Google Sheets while routing failures to an Exceptions tab. How it works 1. Triggers every minute when a new Gmail message arrives under a specified label and has attachments, downloading the attachments for processing. 2. Filters the message to keep only PDF attachments. 3. Converts the PDF attachment into plain text. 4. Sends the extracted text to OpenAI to extract structured invoice data (supplier, invoice number, dates, currency, totals, VAT, and line items) using a strict schema. 5. Validates the extracted values by checking required fields, total reconciliation (net + VAT \u2248 gross), line-item sums, allowed VAT rates, and flags negative totals. 6. Appends validated invoices to the Invoices sheet in Google Sheets and sends any non-reconciling results (with problem details) to an Exceptions sheet. Setup 1. Add Gmail credentials and set the Gmail label ID used to identify supplier invoice emails. 2. Add an OpenAI API credential for the extraction model used by the workflow. 3. Add Google Sheets credentials and replace the spreadsheet URL, ensuring it contains Invoices and Exceptions tabs with columns that match the extracted fields. Additional info I wrote a longer page on this one, with what it costs to run and when I would tell you not to build it: https://fractionalhq.uk/use-cases/invoice-data-entry"
}
}