{
  "name": "Automate 3-way invoice matching from Gmail to Xero with Slack and Teams alerts",
  "nodes": [
    {
      "id": "88f50ca9-6391-4c14-8911-693d80438404",
      "name": "Sticky_Ingestion",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        432
      ],
      "parameters": {
        "width": 450,
        "height": 450,
        "content": "## 🛡️ 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"
      }
    },
    {
      "id": "50a1ba7c-380c-4d65-9568-334e52991050",
      "name": "Sticky_Intelligence",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        432
      ],
      "parameters": {
        "width": 516,
        "height": 450,
        "content": "## 🤖 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"
      }
    },
    {
      "id": "cd1f23f3-7a46-4b4b-9e56-5903417cbe07",
      "name": "Sticky_Reconciliation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        416
      ],
      "parameters": {
        "width": 466,
        "height": 450,
        "content": "## ⚖️ 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, th"
      }
    },
    {
      "id": "1080d80a-eed4-48e6-9092-4bff6f8d286b",
      "name": "Sticky_Alerting",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1728,
        384
      ],
      "parameters": {
        "width": 480,
        "height": 530,
        "content": "## 📢 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 "
      }
    },
    {
      "id": "f29a6faf-585e-4ecb-bd1e-d61fb5853567",
      "name": "Gmail: Watch Invoices",
      "type": "n8n-nodes-base.gmail",
      "position": [
        320,
        672
      ]
    },
    {
      "id": "0a6a8dc4-3a42-4ed6-bb8d-d3bfa5f2a2dd",
      "name": "Vault: Get Decryption Key",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        512,
        672
      ]
    },
    {
      "id": "fa3a5b86-b35a-4d8e-bc66-ba7cbb57e66c",
      "name": "Intelligence Engine",
      "type": "n8n-nodes-base.code",
      "position": [
        896,
        672
      ]
    },
    {
      "id": "ac6790df-e99e-448e-9a03-a35f58e46138",
      "name": "Drive: Fetch PO & Receipt",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1072,
        672
      ]
    },
    {
      "id": "c95e9f61-d725-4574-bdfd-4aa54ed91e6a",
      "name": "Xero: Create Bill",
      "type": "n8n-nodes-base.xero",
      "position": [
        1552,
        672
      ]
    },
    {
      "id": "8cf48209-29c3-4e0f-8136-b09e822ff5ee",
      "name": "Switch: Alert Channel",
      "type": "n8n-nodes-base.switch",
      "position": [
        1792,
        672
      ]
    },
    {
      "id": "5fbb0622-f334-4047-8126-750174854ec6",
      "name": "Slack: High Value Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        2032,
        576
      ]
    },
    {
      "id": "945802e4-79fc-4aad-a242-aed8a433c520",
      "name": "Teams: Dept Head Notify",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2048,
        752
      ]
    },
    {
      "id": "0872297a-b349-48d5-b398-f0eb517f7a35",
      "name": "MAIN_GLOBAL_INFO",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -384,
        -176
      ],
      "parameters": {
        "width": 572,
        "height": 532,
        "content": "## 🚀 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 e"
      }
    },
    {
      "id": "63956a43-90e2-42d3-a4f4-ba33e05a2f91",
      "name": "Unlock password protected PDF",
      "type": "n8n-nodes-htmlcsstopdf.htmlcsstopdf",
      "position": [
        720,
        672
      ]
    },
    {
      "id": "dd6b9f2a-5371-4888-b73c-ea9b58a7946f",
      "name": "Merge multiple PDFS into one",
      "type": "n8n-nodes-htmlcsstopdf.htmlcsstopdf",
      "position": [
        1312,
        672
      ]
    }
  ],
  "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
          }
        ]
      ]
    }
  }
}