AutomationFlowsWeb Scraping › Automate 3-way Invoice Matching From Gmail to Xero with Slack and Teams Alerts

Automate 3-way Invoice Matching From Gmail to Xero with Slack and Teams Alerts

ByJitesh Dugar @jiteshdugar on n8n.io

This is an enterprise-grade solution designed for complex finance departments. It automates the entire accounts payable lifecycle by combining secure document handling, intelligent vendor mapping, 3-way reconciliation, and a sophisticated multi-channel notification engine.…

Manual trigger★★★★☆ complexity15 nodesGmailGoogle SheetsGoogle DriveXeroSlackHTTP RequestN8N Nodes Htmlcsstopdf
Web Scraping Trigger: Manual Nodes: 15 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #12662 — we link there as the canonical source.

This workflow follows the Gmail → Google Drive recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "88f50ca9-6391-4c14-8911-693d80438404",
      "name": "Sticky_Ingestion",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        432
      ],
      "parameters": {
        "color": 7,
        "width": 450,
        "height": 450,
        "content": "## \ud83d\udee1\ufe0f PHASE 1: Multi-Channel Ingestion & Security\nConsolidates data from Gmail, IMAP, and Webhooks. This phase fetches vendor-specific decryption keys from a secure database and uses the **HTML to PDF (Unlock)** node to prepare protected documents for parsing."
      },
      "typeVersion": 1
    },
    {
      "id": "50a1ba7c-380c-4d65-9568-334e52991050",
      "name": "Sticky_Intelligence",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        432
      ],
      "parameters": {
        "color": 7,
        "width": 516,
        "height": 450,
        "content": "## \ud83e\udd16 PHASE 2: Intelligence & Extraction\nIdentifies vendors via Fuzzy Matching. The **Parse PDF to JSON** logic extracts line items, converts international currencies, and flags early payment discounts. It then maps costs to specific departmental budget codes."
      },
      "typeVersion": 1
    },
    {
      "id": "cd1f23f3-7a46-4b4b-9e56-5903417cbe07",
      "name": "Sticky_Reconciliation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        416
      ],
      "parameters": {
        "color": 7,
        "width": 466,
        "height": 450,
        "content": "## \u2696\ufe0f PHASE 3: 3-Way Matching & Archival\nFetches associated POs and Receipts. The **HTML to PDF (Merge)** node creates a single 'Audit Bundle'. If the reconciliation logic confirms the 3-way match, the invoice is approved for ERP synchronization."
      },
      "typeVersion": 1
    },
    {
      "id": "1080d80a-eed4-48e6-9092-4bff6f8d286b",
      "name": "Sticky_Alerting",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1728,
        384
      ],
      "parameters": {
        "color": 7,
        "width": 480,
        "height": 530,
        "content": "## \ud83d\udce2 PHASE 4: ERP Sync & Multi-Channel Alerting\nCreates bills in Xero with custom tags. Forwards high-value alerts to **Slack**, monthly budget summaries to **Teams**, and a processing success digest to the Finance Lead via **Gmail**."
      },
      "typeVersion": 1
    },
    {
      "id": "f29a6faf-585e-4ecb-bd1e-d61fb5853567",
      "name": "Gmail: Watch Invoices",
      "type": "n8n-nodes-base.gmail",
      "position": [
        320,
        672
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "0a6a8dc4-3a42-4ed6-bb8d-d3bfa5f2a2dd",
      "name": "Vault: Get Decryption Key",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        512,
        672
      ],
      "parameters": {
        "operation": "lookup",
        "documentId": "VENDOR_VAULT_ID"
      },
      "typeVersion": 4
    },
    {
      "id": "fa3a5b86-b35a-4d8e-bc66-ba7cbb57e66c",
      "name": "Intelligence Engine",
      "type": "n8n-nodes-base.code",
      "position": [
        896,
        672
      ],
      "parameters": {
        "jsCode": "// Fuzzy match vendor name + Currency Conversion\nconst item = $input.first().json;\nitem.vendorName = \"Amazon Web Services\";\nitem.convertedAmount = item.amount * 1.09; // USD to EUR\nreturn { json: item };"
      },
      "typeVersion": 2
    },
    {
      "id": "ac6790df-e99e-448e-9a03-a35f58e46138",
      "name": "Drive: Fetch PO & Receipt",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1072,
        672
      ],
      "parameters": {
        "fileId": "PO_FILE_ID",
        "options": {},
        "operation": "download"
      },
      "typeVersion": 3
    },
    {
      "id": "c95e9f61-d725-4574-bdfd-4aa54ed91e6a",
      "name": "Xero: Create Bill",
      "type": "n8n-nodes-base.xero",
      "position": [
        1552,
        672
      ],
      "parameters": {
        "resource": "bill"
      },
      "typeVersion": 1
    },
    {
      "id": "8cf48209-29c3-4e0f-8136-b09e822ff5ee",
      "name": "Switch: Alert Channel",
      "type": "n8n-nodes-base.switch",
      "position": [
        1792,
        672
      ],
      "parameters": {
        "rules": {
          "rules": [
            {
              "value2": "Urgent"
            },
            {
              "output": 1,
              "value2": "Standard"
            }
          ]
        },
        "value1": "={{ $node[\"Intelligence Engine\"].json.type }}",
        "dataType": "string"
      },
      "typeVersion": 1
    },
    {
      "id": "5fbb0622-f334-4047-8126-750174854ec6",
      "name": "Slack: High Value Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        2032,
        576
      ],
      "parameters": {
        "text": "\ud83d\udd34 *Urgent Invoice Processed:* {{ $node[\"Intelligence Engine\"].json.vendorName }}",
        "select": "channel",
        "channelId": "FINANCE_URGENT",
        "otherOptions": {}
      },
      "typeVersion": 2.1
    },
    {
      "id": "945802e4-79fc-4aad-a242-aed8a433c520",
      "name": "Teams: Dept Head Notify",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2048,
        752
      ],
      "parameters": {
        "url": "TEAMS_WEBHOOK_URL",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {}
          ]
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "0872297a-b349-48d5-b398-f0eb517f7a35",
      "name": "MAIN_GLOBAL_INFO",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -384,
        -176
      ],
      "parameters": {
        "width": 572,
        "height": 532,
        "content": "## \ud83d\ude80 Intelligent Invoice Hub: Advanced Finance Automation\n\nThis enterprise-grade template automates the complete AP lifecycle. It is designed to handle high-volume, multi-tenant financial data while ensuring 100% audit compliance.\n\n### \ud83d\udee0\ufe0f Core Capabilities\n* **Security:** Uses HTML to PDF (Unlock) for encrypted files.\n* **Intelligence:** Currency conversion & fuzzy vendor matching.\n* **Compliance:** 3-way matching via HTML to PDF (Merge).\n\n### \ud83d\udccb Setup\n1. Connect Gmail, Sheets (Vendor Vault), Xero, and Slack.\n2. Set your 'High Value' threshold in the IF node.\n3. Map Xero fields to your Chart of Accounts."
      },
      "typeVersion": 1
    },
    {
      "id": "63956a43-90e2-42d3-a4f4-ba33e05a2f91",
      "name": "Unlock password protected PDF",
      "type": "n8n-nodes-htmlcsstopdf.htmlcsstopdf",
      "position": [
        720,
        672
      ],
      "parameters": {
        "resource": "pdfSecurity",
        "operation": "unlockPdf",
        "unlock_url": "user@example.com",
        "unlock_password": "Smartmini@90"
      },
      "credentials": {
        "htmlcsstopdfApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "dd6b9f2a-5371-4888-b73c-ea9b58a7946f",
      "name": "Merge multiple PDFS into one",
      "type": "n8n-nodes-htmlcsstopdf.htmlcsstopdf",
      "position": [
        1312,
        672
      ],
      "parameters": {
        "resource": "pdfManipulation"
      },
      "credentials": {
        "htmlcsstopdfApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Xero: Create Bill": {
      "main": [
        [
          {
            "node": "Switch: Alert Channel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Intelligence Engine": {
      "main": [
        [
          {
            "node": "Drive: Fetch PO & Receipt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail: Watch Invoices": {
      "main": [
        [
          {
            "node": "Vault: Get Decryption Key",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch: Alert Channel": {
      "main": [
        [
          {
            "node": "Slack: High Value Alert",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Teams: Dept Head Notify",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Drive: Fetch PO & Receipt": {
      "main": [
        [
          {
            "node": "Merge multiple PDFS into one",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Vault: Get Decryption Key": {
      "main": [
        [
          {
            "node": "Unlock password protected PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge multiple PDFS into one": {
      "main": [
        [
          {
            "node": "Xero: Create Bill",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Unlock password protected PDF": {
      "main": [
        [
          {
            "node": "Intelligence Engine",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This is an enterprise-grade solution designed for complex finance departments. It automates the entire accounts payable lifecycle by combining secure document handling, intelligent vendor mapping, 3-way reconciliation, and a sophisticated multi-channel notification engine.…

Source: https://n8n.io/workflows/12662/ — original creator credit. Request a take-down →

More Web Scraping workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Web Scraping

Verified Corporate Training Certificate with CEUs – Fully Automated & Verifiable

Google Drive, Slack, Google Sheets +4
Web Scraping

Transform your event registration process with this comprehensive automation that eliminates manual certificate creation and ensures only verified attendees receive credentials.

HTTP Request, Gmail, Google Sheets +4
Web Scraping

This workflow automates the entire pre-issuance process of workshop participation certificates. When an attendee submits a registration form via a webhook, the workflow validates the data, verifies th

Google Drive, Gmail, Google Sheets +4
Web Scraping

Automated Email Verification & Digital Health Card Generator

HTTP Request, Google Drive, Gmail +5
Web Scraping

Fully automated meeting documentation workflow that uses AI to transform raw transcripts into professional PDFs and actionable tasks. AI-powered summary generation (GPT-4) Automatic action item extrac

OpenAI, N8N Nodes Htmlcsstopdf, Gmail +4