{
  "name": "Automated financial document processing with Google Gemini OCR",
  "nodes": [
    {
      "id": "ec55993a-2652-4e2d-9e25-3e507f93c487",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -560,
        912
      ]
    },
    {
      "id": "ce9ddc97-8776-4805-9299-e8898ccd4cdc",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        128,
        1120
      ]
    },
    {
      "id": "a4788bf0-20d2-4e21-9e68-37202475cdcd",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -976,
        912
      ],
      "parameters": {
        "width": 340,
        "height": 420,
        "content": "# Mark - Accountant\n\n![My Image](https://i.postimg.cc/XqKMCBkM/Chat-GPT-Image-Apr-25-2025-06-09-53-AM.png)\n\n"
      }
    },
    {
      "id": "25cc249b-c780-4a34-8cbb-b2aa8a8adf54",
      "name": "Confirmation",
      "type": "n8n-nodes-base.set",
      "position": [
        768,
        912
      ]
    },
    {
      "id": "82edfbf5-53d1-4105-ae08-85fdd4d4a5de",
      "name": "Parsed Data",
      "type": "n8n-nodes-base.set",
      "position": [
        -48,
        1120
      ]
    },
    {
      "id": "b5293bee-dadb-4de1-9142-4efaf432d90f",
      "name": "Upload PDF to Google Gemini",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -432,
        1120
      ]
    },
    {
      "id": "3679bcea-f0aa-4c4e-82b0-43c147564377",
      "name": "Download Data from Google Gemini",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -240,
        1120
      ]
    },
    {
      "id": "2951c2d7-f543-4ea7-acdb-67b9fa9c8d31",
      "name": "Table ERP",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        288,
        1120
      ]
    },
    {
      "id": "d96a6fe2-fe52-4bdc-8199-7c5de0e18d03",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -576,
        -2048
      ]
    },
    {
      "id": "60c60b57-a29c-4b84-a364-7ff194338a23",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        416,
        912
      ]
    },
    {
      "id": "67e50b05-8095-4733-b14d-aac6181163aa",
      "name": "Update File Name",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        592,
        912
      ]
    },
    {
      "id": "08e9f03b-c1b5-4d53-8d63-5be9c1f57187",
      "name": "Save Invoice",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -240,
        912
      ]
    },
    {
      "id": "65beec00-7e7f-4f2c-8e49-8c5bc9bcac5a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        832
      ],
      "parameters": {
        "width": 1988,
        "height": 528,
        "content": "# Invoice Processing"
      }
    },
    {
      "id": "d9428d0b-67e2-4f01-af5c-418814e5adbf",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        -144
      ],
      "parameters": {
        "width": 1604,
        "height": 608,
        "content": "# Expenses Processing"
      }
    },
    {
      "id": "49d55301-45d9-436a-be83-205938ac8e43",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -976,
        -64
      ],
      "parameters": {
        "width": 340,
        "height": 480,
        "content": "# Donna - Accountant\n\n![My Image](https://i.postimg.cc/yY6MHQ0m/Chat-GPT-Image-Apr-25-2025-12-19-57-PM.png)\n\n"
      }
    },
    {
      "id": "c638cf56-555c-489d-bb83-bf385ae88af4",
      "name": "Google Drive Trigger",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -544,
        80
      ]
    },
    {
      "id": "947a8138-e565-4738-b1c8-8b85068ba6e4",
      "name": "Split Out1",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        400,
        -80
      ]
    },
    {
      "id": "df7a4279-7e74-4faf-8d5a-b87a657ce9d2",
      "name": "Parsed Data1",
      "type": "n8n-nodes-base.set",
      "position": [
        240,
        -128
      ]
    },
    {
      "id": "32e2ac3c-d6eb-404b-99df-0ed49d18b3fe",
      "name": "Upload PDF to Google Gemini1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -160,
        -128
      ]
    },
    {
      "id": "2a020ce2-5406-410f-8530-42c8abdc2128",
      "name": "Download Data from Google Gemini1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        32,
        -128
      ]
    },
    {
      "id": "0f89afbd-3b0b-48a6-b92d-838655f3424e",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        192,
        128
      ]
    },
    {
      "id": "dbe2be8e-98f0-4c74-81ef-b69d80e7759d",
      "name": "Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -368,
        -128
      ]
    },
    {
      "id": "dc065b83-bae9-4cde-bfc4-2440964d600c",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        -1136
      ],
      "parameters": {
        "width": 2136,
        "height": 512,
        "content": "# Expenses Processing"
      }
    },
    {
      "id": "84d2f0ab-ae05-452b-8b00-76c74f167959",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -976,
        -1056
      ],
      "parameters": {
        "width": 340,
        "height": 420,
        "content": "# Victor - Controller\n![My Image](https://i.postimg.cc/m2fryF1z/Chat-GPT-Image-Apr-25-2025-05-10-57-PM.png)\n\n"
      }
    },
    {
      "id": "f8c79b50-6d77-45f1-b7df-4b48a992402d",
      "name": "Google Drive Trigger1",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -480,
        -976
      ]
    },
    {
      "id": "529732d1-eee3-471d-80b7-0ac6320ed6d2",
      "name": "Upload PDF to Google Gemini2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        48,
        -976
      ]
    },
    {
      "id": "1765ea24-57c2-4c5f-9ca0-70338934195d",
      "name": "Download Data from Google Gemini2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        256,
        -976
      ]
    },
    {
      "id": "6d94b80f-914f-4c60-b0b8-1fec176ba707",
      "name": "Google Sheets1",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        736,
        -976
      ]
    },
    {
      "id": "55f393cc-9c47-42db-8803-f1e090459605",
      "name": "Google Drive1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -256,
        -976
      ]
    },
    {
      "id": "4b5d634e-53f9-41d5-938c-7cf6efe61411",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        912,
        -976
      ]
    },
    {
      "id": "03bc404a-d364-42b4-900f-ca61e4dd9b67",
      "name": "Edit Fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        400,
        128
      ]
    },
    {
      "id": "347e16d9-febc-4f44-8539-112ca95e3df5",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        -976
      ]
    },
    {
      "id": "5ebbafe9-d67e-4e86-be8c-e02c79f177d4",
      "name": "Basic LLM Chain",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "position": [
        -160,
        128
      ]
    },
    {
      "id": "f1a9203a-0d21-46f0-aa9a-afff675427dc",
      "name": "OpenRouter Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -160,
        304
      ]
    },
    {
      "id": "9638204f-cb80-4fb5-a146-055160fd1437",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -16,
        304
      ]
    },
    {
      "id": "1cbde03d-4562-4b08-9001-e3e13bc7cf9b",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -352,
        -2048
      ]
    },
    {
      "id": "a0d38cbe-d401-458d-afde-7b46172f1b9a",
      "name": "OpenRouter Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -448,
        -1808
      ]
    },
    {
      "id": "8fea6832-8064-46d3-a71e-eb42b325e58b",
      "name": "Invoices",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        -128,
        -1808
      ]
    },
    {
      "id": "39e1c9dd-e85d-4548-8c62-24209f4b8fc0",
      "name": "Expenses",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        -32,
        -1808
      ]
    },
    {
      "id": "df86bfde-6554-4bfd-8cfe-3cc2cfc6d4f8",
      "name": "Transactions",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        64,
        -1808
      ]
    },
    {
      "id": "bf1db04b-5b67-4334-ab21-1e6e4d40fa6a",
      "name": "Edit Fields2",
      "type": "n8n-nodes-base.set",
      "position": [
        0,
        -2048
      ]
    },
    {
      "id": "64afa6b9-e8eb-4d73-b124-c19f4051e75d",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -960,
        -2080
      ],
      "parameters": {
        "width": 340,
        "height": 420,
        "content": "# Andrew - CFO\n\n![My Image](https://i.postimg.cc/xT23Z3Ty/Chat-GPT-Image-Apr-24-2025-08-02-30-AM.png)\n"
      }
    },
    {
      "id": "583b7a38-910e-4c9f-8c8d-cd0997addc60",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -976,
        -2160
      ],
      "parameters": {
        "width": 1232,
        "height": 520,
        "content": "# Finance\n"
      }
    },
    {
      "id": "953aaa49-78d5-44b3-846b-c139b2c1d9cb",
      "name": "Sticky Note25",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3792,
        1104
      ],
      "parameters": {
        "width": 1344,
        "height": 816,
        "content": "# AutoSolutions.ai - AI Consulting Services\n## Didac Fernandez Girona\n\n\n\n![My Image](https://i.postimg.cc/qvRLbFDL/Long-logo.png)"
      }
    },
    {
      "id": "b39dfed5-8164-4ea1-939f-6ed5ade480ba",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3984,
        -2480
      ],
      "parameters": {
        "width": 784,
        "height": 2256,
        "content": "# 🤖 AI-Powered Financial Document Processing Workflow\n\n## 📋 Overview\nThis comprehensive workflow automates financial document processing using AI, handling invoices, expense receipts, and bank stateme"
      }
    },
    {
      "id": "82e8c619-a09b-42bf-b6b9-773d20e821ac",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3120,
        -848
      ],
      "parameters": {
        "width": 784,
        "height": 640,
        "content": "# 🛠️ Setup Requirements\n\n### 🌐 Google Services\n1. **🚗 Google Drive API** credentials configured\n2. **📊 Google Sheets API** credentials configured  \n3. **🧠 Google Gemini API** credentials configured\n4."
      }
    },
    {
      "id": "d842268b-9d80-42da-952c-a0681736a584",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3120,
        -2480
      ],
      "parameters": {
        "width": 784,
        "height": 1600,
        "content": "# 🎯 How to Use\n\n### 📄 Processing Invoices\n1. 💬 Access the chat interface\n2. 📤 Upload PDF invoice files\n3. ⏳ Wait for AI processing and confirmation\n4. ✅ Check \"Test Invoice Records\" Google Sheet for e"
      }
    },
    {
      "id": "114a10ca-24f0-492d-af38-45795bab1666",
      "name": "📄 Invoice Processing Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2224,
        816
      ],
      "parameters": {
        "width": 772,
        "height": 1112,
        "content": "# 📄 INVOICE PROCESSING SECTION\n\n## 🎯 Purpose\nThis section handles invoice processing through a chat interface. Mark, the AI Accountant, extracts key invoice data and stores it in Google Sheets.\n\n## 🔄 "
      }
    },
    {
      "id": "b838b4c4-545c-411d-b6cd-9041479f72e9",
      "name": "Mark - Accountant",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1344,
        832
      ],
      "parameters": {
        "width": 324,
        "height": 528,
        "content": "# Mark - Accountant 👨‍💼\n\n**Role**: Invoice Processing Specialist\n\n**Responsibilities**:\n- ✅ Extract vendor information\n- ✅ Capture payment terms\n- ✅ Process line item details\n- ✅ Ensure data accuracy\n"
      }
    },
    {
      "id": "de948508-c38d-47aa-9a57-3972a854fd3f",
      "name": "💾 Save File Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1344,
        1392
      ],
      "parameters": {
        "width": 268,
        "height": 488,
        "content": "# 📤 STEP 1: File Upload & Storage\n\n**Purpose**: Save uploaded invoice to Google Drive\n\n**Configuration**:\n- 📁 Target Folder: \"Invoices\"\n- 📄 Input Field: data0 (from chat upload)\n- 📝 Filename: Uses ori"
      }
    },
    {
      "id": "d76a1641-f669-4ca7-a72e-ea3a5f3cd6c9",
      "name": "🤖 Upload to AI Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1056,
        1392
      ],
      "parameters": {
        "width": 220,
        "height": 488,
        "content": "# 🤖 STEP 2: AI Upload\n\n**Purpose**: Upload PDF to Google Gemini for processing\n\n**Configuration**:\n- 🔗 Endpoint: Gemini File Upload API\n- 📄 Content-Type: application/pdf\n- 🔐 Auth: Google PaLM API cred"
      }
    },
    {
      "id": "f91e1f93-c743-400a-bbd9-520edd6169d0",
      "name": "🧠 Data Extraction Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        1392
      ],
      "parameters": {
        "width": 252,
        "height": 488,
        "content": "# 🧠 STEP 3: Data Extraction\n\n**Purpose**: Use Gemini AI to extract structured invoice data\n\n**AI Prompt**: Extracts:\n- 🏢 Vendor Name\n- 🔢 Invoice Number\n- 📅 Invoice Date\n- 📅 Due Date\n- 💰 Total Amount\n-"
      }
    },
    {
      "id": "aa42f2bd-4ee3-45f3-a671-33eff825a42e",
      "name": "📋 JSON Parsing Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -544,
        1392
      ],
      "parameters": {
        "width": 236,
        "height": 488,
        "content": "# 📋 STEP 4: JSON Parsing\n\n**Purpose**: Clean and parse AI response into structured data\n\n**Process**:\n- 🧹 Remove markdown code blocks\n- 📊 Convert text to JSON object\n- ⚠️ Handle parsing errors gracefu"
      }
    },
    {
      "id": "4207bb87-5651-4107-afd1-c74fa3ffe2e9",
      "name": "📑 Split Items Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        1392
      ],
      "parameters": {
        "width": 236,
        "height": 488,
        "content": "# 📑 STEP 5: Line Item Processing\n\n**Purpose**: Split line items for individual spreadsheet rows\n\n**Process**:\n- 📋 Extract Line Items array from parsed data\n- 🔄 Create separate execution for each line "
      }
    },
    {
      "id": "09ea2e0e-3455-4a4f-b104-caf7e145ed59",
      "name": "📊 Save to Sheet Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        1392
      ],
      "parameters": {
        "width": 268,
        "height": 488,
        "content": "# 📊 STEP 6: Save to Spreadsheet\n\n**Purpose**: Store extracted invoice data in Google Sheets\n\n**Mapping**:\n- 🏢 Vendor Name → Header data\n- 🔢 Invoice Number → Header data\n- 📅 Dates → Header data\n- 💰 Amo"
      }
    },
    {
      "id": "7696a262-8c9c-4f0a-89ba-0998fef40fcb",
      "name": "🔗 Merge Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        256,
        1392
      ],
      "parameters": {
        "width": 218,
        "height": 486,
        "content": "# 🔗 STEP 7: Data Merge\n\n**Purpose**: Combine file metadata with processed data\n\n**Inputs**:\n- 📁 File information from Google Drive\n- 📊 Processed invoice data from sheets\n\n**Output**: Combined data for"
      }
    },
    {
      "id": "f6db208f-ead8-4762-afde-d82c511344e8",
      "name": "📝 Rename Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        496,
        1392
      ],
      "parameters": {
        "width": 202,
        "height": 486,
        "content": "# 📝 STEP 8: File Renaming\n\n**Purpose**: Rename file with vendor and invoice number\n\n**Format**: \"{Vendor Name} - {Invoice Number}\"\n\n**Example**: \"Acme Corp - INV-2024-001\"\n\n**Error Handling**: Continu"
      }
    },
    {
      "id": "c23af4ed-ad50-4992-8bd2-fb884121e17c",
      "name": "✅ Confirmation Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        720,
        1392
      ],
      "parameters": {
        "width": 250,
        "height": 486,
        "content": "# ✅ STEP 9: Confirmation\n\n**Purpose**: Send success message to user\n\n**Message**: Confirms invoice processing completion\n\n**Includes**: Reference to check Google Sheet\n\n**User Experience**: Clear feed"
      }
    },
    {
      "id": "619818b5-2e30-46ef-a1fe-c9653e9fe662",
      "name": "🧾 Expense Processing Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2224,
        -448
      ],
      "parameters": {
        "width": 772,
        "height": 1232,
        "content": "# 🧾 EXPENSE PROCESSING SECTION\n\n## 🎯 Purpose\nThis section monitors a Google Drive folder for new expense receipts. Donna, the AI Accountant, extracts expense data and automatically categorizes it usin"
      }
    },
    {
      "id": "be419798-2cc6-4819-9a1d-59201efe77c3",
      "name": "📁 Expense Trigger Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        176
      ],
      "parameters": {
        "width": 492,
        "height": 296,
        "content": "# 📁 EXPENSE TRIGGER\n\n**Purpose**: Monitor Google Drive folder for new expense receipts\n\n**Configuration**:\n- 📂 Folder: \"Expense Receipts\"\n- ⏰ Frequency: Every minute\n- 🚨 Event: File created\n- 📄 File T"
      }
    },
    {
      "id": "791fb721-f346-42d8-9628-1d5b2db5ab24",
      "name": "🏷️ Categorization Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        -144
      ],
      "parameters": {
        "width": 492,
        "height": 296,
        "content": "# 🏷️ AI CATEGORIZATION\n\n**Purpose**: Automatically categorize expenses using AI\n\n**Process**:\n- 🤖 Uses OpenRouter LLM\n- 📋 17 predefined categories\n- 🎯 Structured JSON output\n- 🧠 Context-aware classifi"
      }
    },
    {
      "id": "39b5e552-93b9-437b-b2ce-2ca403a7cd8a",
      "name": "🏦 Bank Statement Processing Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2224,
        -1328
      ],
      "parameters": {
        "width": 772,
        "height": 856,
        "content": "# 🏦 BANK STATEMENT PROCESSING SECTION\n\n## 🎯 Purpose\nThis section monitors a Google Drive folder for new bank statements. Victor, the AI Controller, extracts transaction data for reconciliation and ana"
      }
    },
    {
      "id": "cba011da-354b-4c58-9942-f6f5fb6b4135",
      "name": "Victor - Controller",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1344,
        -1136
      ],
      "parameters": {
        "width": 324,
        "height": 512,
        "content": "# Victor - Controller 👨‍💼\n\n**Role**: Bank Statement Processing & Transaction Reconciliation\n\n**Responsibilities**:\n- ✅ Extract transaction details\n- ✅ Process multiple transactions per statement\n- ✅ M"
      }
    },
    {
      "id": "c3b83adc-d38c-4b18-ae37-a5e801c7b4d5",
      "name": "🔄 Bank Parser Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        -1136
      ],
      "parameters": {
        "width": 348,
        "height": 504,
        "content": "# 🔄 CUSTOM TRANSACTION PARSER\n\n**Purpose**: Parse multiple bank transactions from AI response\n\n**Features**:\n- 🧹 Cleans JSON formatting\n- 📊 Handles multiple response formats\n- 🔄 Converts to n8n array "
      }
    },
    {
      "id": "173fbf7e-f00e-4ab8-a1b9-a63aacb17648",
      "name": "📈 Financial Analysis Documentation",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2224,
        -2480
      ],
      "parameters": {
        "width": 756,
        "height": 1104,
        "content": "# 📈 FINANCIAL ANALYSIS AGENT SECTION\n\n## 🎯 Purpose\nAndrew, the AI CFO, provides intelligent financial analysis and reporting. He can access all three financial spreadsheets and answer complex queries "
      }
    },
    {
      "id": "3bca707d-5591-48aa-9d2b-463f3d116b87",
      "name": "Andrew - CFO",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        -2160
      ],
      "parameters": {
        "width": 308,
        "height": 512,
        "content": "# Andrew - CFO 👨‍💼\n\n**Role**: Financial Analysis & Strategic Reporting\n\n**Responsibilities**:\n- ✅ Generate financial insights\n- ✅ Answer complex queries\n- ✅ Create executive reports\n- ✅ Provide strate"
      }
    },
    {
      "id": "c12b117e-e2f7-4c01-895a-5d30f1b1d973",
      "name": "📊 Analysis Trigger Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        288,
        -2160
      ],
      "parameters": {
        "width": 300,
        "height": 518,
        "content": "# 📊 ANALYSIS TRIGGER\n\n**Purpose**: Manual trigger for financial analysis queries\n\n**Usage**:\n- 🔘 Enable this trigger when analysis is needed\n- 💬 Send financial queries to the AI agent\n- 📈 Get insights"
      }
    },
    {
      "id": "47cd562d-1c49-46c4-94ab-ce6bd0f2a2de",
      "name": "🗃️ Data Tools Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        -2160
      ],
      "parameters": {
        "width": 302,
        "height": 520,
        "content": "# 🗃️ DATA ACCESS TOOLS\n\n**Purpose**: Connect AI agent to financial spreadsheets\n\n**Tools Available**:\n- 📄 **Invoices Tool**: Invoice records and billing data\n- 🧾 **Expenses Tool**: Categorized expense"
      }
    },
    {
      "id": "e2d55436-ebd7-48a8-9b99-02c04444afad",
      "name": "Donna - Accountant",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1344,
        -144
      ],
      "parameters": {
        "width": 324,
        "height": 608,
        "content": "# Donna - Accountant 👩‍💼\n\n**Role**: Expense Processing & Categorization Specialist\n\n**Responsibilities**:\n- ✅ Extract merchant & transaction details\n- ✅ Categorize expenses automatically\n- ✅ Process r"
      }
    },
    {
      "id": "40503797-869e-46ec-ad59-83f94f78d757",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1376,
        800
      ],
      "parameters": {
        "width": 2416,
        "height": 1152,
        "content": ""
      }
    },
    {
      "id": "e3db55b4-86fe-44f8-9bf8-3e97f5db942f",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1376,
        -176
      ],
      "parameters": {
        "width": 2544,
        "height": 688,
        "content": ""
      }
    },
    {
      "id": "c3f4650a-f442-417d-b446-af32cb3bfeca",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1376,
        -1168
      ],
      "parameters": {
        "width": 2928,
        "height": 576,
        "content": ""
      }
    },
    {
      "id": "5720a9c7-16ec-412b-80ed-a32c70eeb9f6",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1376,
        -2208
      ],
      "parameters": {
        "width": 2352,
        "height": 608,
        "content": ""
      }
    },
    {
      "id": "423bea12-2767-48d3-844b-26815d45960a",
      "name": "Sticky Note26",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3520,
        80
      ],
      "parameters": {
        "width": 848,
        "height": 848,
        "content": "![My Image](https://i.postimg.cc/3RCvSmDS/Untitled-design-10.png)"
      }
    },
    {
      "id": "904576db-3e5a-4b7d-bb64-0f181163ed51",
      "name": "Sticky Note27",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1936,
        -3376
      ],
      "parameters": {
        "width": 1312,
        "height": 784,
        "content": "![My Image](https://i.postimg.cc/k4nQdT9X/replicate-prediction-w27bjb3hxxrm80csj5t8211288.jpg)"
      }
    },
    {
      "id": "4b28450e-ede0-4ac3-8120-19c5dea201ab",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1552,
        -3504
      ],
      "parameters": {
        "width": 544,
        "height": 80,
        "content": "# Virtual Accounting Department"
      }
    }
  ],
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Google Sheets1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Update File Name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Edit Fields2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Expenses": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Invoices": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Table ERP",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Table ERP": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Split Out1": {
      "main": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parsed Data": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive": {
      "main": [
        [
          {
            "node": "Upload PDF to Google Gemini1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parsed Data1": {
      "main": [
        [
          {
            "node": "Split Out1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Invoice": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transactions": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive1": {
      "main": [
        [
          {
            "node": "Upload PDF to Google Gemini2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets1": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic LLM Chain": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update File Name": {
      "main": [
        [
          {
            "node": "Confirmation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger": {
      "main": [
        [
          {
            "node": "Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Drive Trigger1": {
      "main": [
        [
          {
            "node": "Google Drive1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenRouter Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Basic LLM Chain",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Upload PDF to Google Gemini",
            "type": "main",
            "index": 0
          },
          {
            "node": "Save Invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload PDF to Google Gemini": {
      "main": [
        [
          {
            "node": "Download Data from Google Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload PDF to Google Gemini1": {
      "main": [
        [
          {
            "node": "Download Data from Google Gemini1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload PDF to Google Gemini2": {
      "main": [
        [
          {
            "node": "Download Data from Google Gemini2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Data from Google Gemini": {
      "main": [
        [
          {
            "node": "Parsed Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Upload PDF to Google Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Data from Google Gemini1": {
      "main": [
        [
          {
            "node": "Parsed Data1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Upload PDF to Google Gemini1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Data from Google Gemini2": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Upload PDF to Google Gemini2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}