{
  "name": "Automate invoice processing with GPT-4o classification and XML export to accounting",
  "nodes": [
    {
      "id": "sticky-overview",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -368,
        288
      ],
      "parameters": {
        "width": 420,
        "height": 752,
        "content": "## Intelligent Invoice Processing with AI Classification and XML Export\n\n### Overview\nAutomated invoice processing pipeline that extracts data from PDF invoices, uses AI for intelligent categorization"
      }
    },
    {
      "id": "sticky-step1",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        640
      ],
      "parameters": {
        "width": 260,
        "height": 120,
        "content": "### Step 1: Invoice Detection\n- Monitor Google Drive folder\n- Filter for PDF files only\n- Download invoice content"
      }
    },
    {
      "id": "sticky-step2",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        624
      ],
      "parameters": {
        "width": 260,
        "height": 120,
        "content": "### Step 2: Data Extraction\n- Extract text from PDF\n- Parse invoice fields\n- Structure data for AI analysis"
      }
    },
    {
      "id": "sticky-step3",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        912,
        608
      ],
      "parameters": {
        "width": 260,
        "height": 124,
        "content": "### Step 3: AI Classification\n- AI Agent categorizes expense\n- Detects unusual patterns\n- Suggests GL codes\n- Determines approval needs"
      }
    },
    {
      "id": "sticky-step4",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        272,
        1120
      ],
      "parameters": {
        "width": 260,
        "height": 140,
        "content": "### Step 4: Export & Archive\n- Convert to XML format\n- Route high-value for approval\n- Archive to Sheets\n- Send notifications"
      }
    },
    {
      "id": "drive-trigger",
      "name": "New Invoice Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        112,
        304
      ]
    },
    {
      "id": "webhook-trigger",
      "name": "Manual Upload Trigger",
      "type": "n8n-nodes-base.webhook",
      "position": [
        112,
        480
      ]
    },
    {
      "id": "merge-triggers",
      "name": "Merge Triggers",
      "type": "n8n-nodes-base.merge",
      "position": [
        320,
        384
      ]
    },
    {
      "id": "filter-pdf",
      "name": "Filter PDF Files",
      "type": "n8n-nodes-base.filter",
      "position": [
        528,
        384
      ]
    },
    {
      "id": "download-pdf",
      "name": "Download Invoice PDF",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        720,
        384
      ]
    },
    {
      "id": "extract-pdf",
      "name": "Extract PDF Text",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        928,
        384
      ]
    },
    {
      "id": "parse-invoice",
      "name": "Parse Invoice Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1120,
        384
      ]
    },
    {
      "id": "openai-model",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1264,
        560
      ]
    },
    {
      "id": "ai-classifier",
      "name": "AI Invoice Classifier",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1264,
        384
      ]
    },
    {
      "id": "parse-ai-result",
      "name": "Parse AI Classification",
      "type": "n8n-nodes-base.code",
      "position": [
        160,
        896
      ]
    },
    {
      "id": "convert-xml",
      "name": "Convert to XML",
      "type": "n8n-nodes-base.xml",
      "position": [
        336,
        896
      ]
    },
    {
      "id": "format-xml-output",
      "name": "Format XML Output",
      "type": "n8n-nodes-base.set",
      "position": [
        528,
        896
      ]
    },
    {
      "id": "check-approval",
      "name": "Needs Approval?",
      "type": "n8n-nodes-base.if",
      "position": [
        736,
        896
      ]
    },
    {
      "id": "send-approval-email",
      "name": "Request Approval Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        960,
        800
      ]
    },
    {
      "id": "send-slack-notification",
      "name": "Slack Notification",
      "type": "n8n-nodes-base.slack",
      "position": [
        960,
        992
      ]
    },
    {
      "id": "merge-paths",
      "name": "Merge Processing Paths",
      "type": "n8n-nodes-base.merge",
      "position": [
        1168,
        896
      ]
    },
    {
      "id": "log-to-sheets",
      "name": "Archive to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1360,
        896
      ]
    },
    {
      "id": "respond-webhook",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1568,
        896
      ]
    }
  ],
  "connections": {
    "Convert to XML": {
      "main": [
        [
          {
            "node": "Format XML Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge Triggers": {
      "main": [
        [
          {
            "node": "Filter PDF Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Needs Approval?": {
      "main": [
        [
          {
            "node": "Request Approval Email",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Slack Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract PDF Text": {
      "main": [
        [
          {
            "node": "Parse Invoice Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter PDF Files": {
      "main": [
        [
          {
            "node": "Download Invoice PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format XML Output": {
      "main": [
        [
          {
            "node": "Needs Approval?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Invoice Classifier",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Parse Invoice Data": {
      "main": [
        [
          {
            "node": "AI Invoice Classifier",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Slack Notification": {
      "main": [
        [
          {
            "node": "Merge Processing Paths",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Invoice Trigger": {
      "main": [
        [
          {
            "node": "Merge Triggers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Invoice PDF": {
      "main": [
        [
          {
            "node": "Extract PDF Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Invoice Classifier": {
      "main": [
        [
          {
            "node": "Parse AI Classification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Upload Trigger": {
      "main": [
        [
          {
            "node": "Merge Triggers",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Merge Processing Paths": {
      "main": [
        [
          {
            "node": "Archive to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request Approval Email": {
      "main": [
        [
          {
            "node": "Merge Processing Paths",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse AI Classification": {
      "main": [
        [
          {
            "node": "Convert to XML",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Archive to Google Sheets": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}