N
n8n Store
Workflow Market
Track personal finances in Google Sheets with AI Agent via Slack

Track personal finances in Google Sheets with AI Agent via Slack

by faiz•0 views

Description

Categories

šŸ“Š ProductivityšŸ¤– AI & Machine Learning

Nodes Used

n8n-nodes-base.coden8n-nodes-base.mergen8n-nodes-base.slackn8n-nodes-base.slackn8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.googleSheets
PriceFree
Views0
Last Updated11/28/2025
workflow.json
{
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "name": "Track personal finances in Google Sheets with AI Agent via Slack",
  "tags": [],
  "nodes": [
    {
      "id": "35177fc2-d800-4ef6-b437-c5ef7f9c60dd",
      "name": "Get Current Balance",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        544,
        176
      ],
      "parameters": {
        "options": {
          "dataLocationOnSheet": {
            "values": {
              "range": "A:D",
              "rangeDefinition": "specifyRangeA1"
            }
          }
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "Google Sheets OAuth2"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "97cd7db6-1766-4b2f-831d-2929bb3e612e",
      "name": "Get Active Debts",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        544,
        368
      ],
      "parameters": {
        "options": {
          "dataLocationOnSheet": {
            "values": {
              "range": "A:F",
              "rangeDefinition": "specifyRangeA1"
            }
          }
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "Google Sheets OAuth2"
        }
      },
      "typeVersion": 4.4
    },
    {
      "id": "9e584d0c-01b4-4347-9560-398c846a915d",
      "name": "Format Daily Message",
      "type": "n8n-nodes-base.code",
      "position": [
        992,
        272
      ],
      "parameters": {
        "jsCode": "const data = $input.all();\n\nconst flatData = data.length > 0 && Array.isArray(data[0].json) ? data[0].json : data.map(item => item.json);\n\nconst balanceSheet = flatData.filter(item => item.Date);\nconst debtSheet = flatData.filter(item => item.Person_Name);\n\nconst currentBalance = balanceSheet[balanceSheet.length - 1];\n\nconst activeDebts = debtSheet.filter(item => item.Status === \"Active\");\n\nconst totalActiveDebt = activeDebts.reduce((sum, debt) => sum + debt.Amount, 0);\n\nlet message = `Daily Finance Check - ${new Date().toISOString().split('T')[0]}\\n`;\nmessage += `Current Balance:\\n`;\nmessage += `  Online: ₹${currentBalance.Online_Balance}\\n`;\nmessage += `  Cash: ₹${currentBalance.Cash_Balance}\\n`;\nmessage += `  Total: ₹${currentBalance.Total_Balance}\\n\\n`;\nmessage += `Active Debts:\\n`;\nmessage += `  They owe you: ₹${totalActiveDebt}\\n`;\n\nactiveDebts.forEach(debt => {\n  message += `    • ${debt.Person_Name}: ₹${debt.Amount}\\n`;\n});\n\nmessage += `\\nPlease share today's transactions:\\n`;\nmessage += `Example format:\\n`;\nmessage += `  - ₹500 cash travel\\n`;\nmessage += `  - ₹200 online food\\n`;\nmessage += `  - Borrowed ₹1000 from Rahul\\n`;\nmessage += `  - Lent ₹500 to Priya\\n`;\nmessage += `  - Rahul paid back ₹500\\n\\n`;\nmessage += `Reply to this message with your transactions!`;\n\nreturn {\n  message: message,\n  currentBalance: currentBalance,\n  activeDebts: activeDebts,\n  totalActiveDebt: totalActiveDebt\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "c1ed8092-f7a7-4b73-8cfb-bffdcf5e13c0",
      "name": "Send Slack Message",
      "type": "n8n-nodes-base.slack",
      "position": [
        1216,
        272
      ],
      "parameters": {
        "text": "={{ $json.message }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "credentials": {
        "slackApi": {
          "id": "",
          "name": "Slack API"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "fa78a016-554f-40b5-8d64-fc66e8cba48b",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        768,
        272
      ],
      "parameters": {},
      "typeVersion": 3.2
    },
    {
      "id": "d57d6590-3a89-48cd-a2b7-966986be0b48",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        480,
        688
      ],
      "parameters": {
        "text": "={{ $json.text }}",
        "options": {
          "systemMessage": "=# Personal Finance AI Agent\n\nYou are a personal finance management AI agent that processes transactions, updates Google Sheets, and communicates via Slack. \n\n## Available Tools\n\n- **Google Gemini Chat Model** - AI reasoning(you)\n- **Postgres Chat Memory** - Conversation context storage\n- **Think** - Internal reasoning\n- **Calculator** - Balance calculations\n- **Get Balances** - Read \"Balances\" sheet\n- **Get Transactions** - Read \"Transactions\" sheet\n- **Get Debts** - Read \"Debts\" sheet\n- **Append or update row in Transactions** - Write transaction records\n- **Append or update row in Debts** - Write debt records\n- **Append or update row in Balances** - Write balance records\n- **replying to the user** - Send Slack message (ends workflow)\n- for reference in logging dates properly here is the day and time now {{ $now }}\n\n## Database Structure\n\n**Balances Sheet:** Date, Cash_Balance, Online_Balance, Total_Balance  \n**Transactions Sheet:** Transaction_ID, Date, Time, Amount, Payment_Type, Category, Transaction_Type, Person_Name, Description, Added_At  \n**Debts Sheet:** Person_Name, Amount, Type, Date_Created, Status, Notes\n\n## Workflow\n\n### Phase 1: Analyze & Parse\n\nUse **Think** to analyze the message:\n\n**Non-Transaction Messages:**\n- Greetings → Respond: \"šŸ‘‹ Hi! I'm your finance assistant. Send transactions like: ₹500 cash food, ₹200 online travel\"\n- Help → Explain capabilities\n- \"No transactions\" → Reply: \"Got it! No transactions to record today. šŸ‘\"\n- Unclear → Ask for clarification\n\n**For Transactions, Extract:**\n- Amount (number)\n- Payment type: cash/online (default: online)\n- Category: travel, food, entertainment, utilities, shopping, health, education, other\n- Transaction type: expense, income, borrowed, lent, owed, repaid\n- Person name (required for debt transactions)\n- Description\n\n**Transaction Type Logic:**\n- \"borrowed from X\" → I owe X, balance +amount\n- \"lent to X\" → X owes me, balance -amount\n- \"X paid back\" → balance +amount, Type: repaid\n- \"owe X\" → balance unchanged, Type: owed\n- Regular expense → balance -amount\n- Income → balance +amount\n\nUse **Postgres Chat Memory** to store parsed data.\n\n### Phase 2: Calculate & Preview\n\n1. Use **Get Balances** to read current balances\n2. Use **Calculator** to compute new balances\n3. Format preview message:\n\n```\nšŸ“‹ Transaction Preview - Please Review:\n\n[For each transaction:]\n[Emoji] ₹[amount] [payment_type] - [category]\nDescription: [description]\n[If person: Person: [name]]\n\nšŸ’” Projected Balance Changes:\nšŸ’µ Cash: ₹[current] → ₹[new] ([+/-]₹[change])\nšŸ’³ Online: ₹[current] → ₹[new] ([+/-]₹[change])\nšŸ“Š Total: ₹[current_total] → ₹[new_total]\n\n[If debts affected:]\nšŸ“ Debt Updates:\n- [Person]: [details]\n\nReply \"yes\"/\"approve\" to proceed or \"no\"/\"cancel\" to abort.\n```\n\n4. Send preview and wait for response\n5. Use **Think** to check approval:\n   - **Accept:** \"yes\", \"approve\", \"confirm\", \"ok\", \"proceed\", \"y\", \"correct\", \"looks good\", \"go ahead\"\n   - **Reject:** \"no\", \"cancel\", \"abort\", \"stop\", \"n\", \"wrong\", \"don't proceed\"\n\nIf rejected, send: \"🚫 Transaction cancelled. No changes made.\" and stop.\n\n### Phase 3: Update Database (Only After Approval)\n\n1. **Append or update row in Transactions:**\n   - Transaction_ID: \"TXN_{timestamp}_{index}\"\n   - Date: YYYY-MM-DD\n   - Time: HH:MM\n   - Added_At: current timestamp\n   - All parsed fields\n\n2. **Append or update row in Debts** (if applicable):\n   - borrowed → Type: \"I_Owe\", Status: \"Active\"\n   - lent → Type: \"They_Owe_Me\", Status: \"Active\"\n   - owed → Type: \"I_Owe\", Status: \"Active\"\n   - repaid → Type: \"Repaid\", Status: \"Settled\"\n\n3. **Append or update row in Balances:**\n   - Date: today (YYYY-MM-DD)\n   - Cash_Balance, Online_Balance, Total_Balance (calculated)\n\n### Phase 4: Send Confirmation\n\nUse **replying to the user** with this format:\n\n```\nāœ… Successfully logged [N] transaction(s)!\n\n[Emoji] ₹[amount] [payment_type] - [category] ([person if applicable])\n...\n\nšŸ’° Updated Balance:\nšŸ’µ Cash: ₹[new_cash] ([+/-]₹[change])\nšŸ’³ Online: ₹[new_online] ([+/-]₹[change])\nšŸ“Š Total: ₹[total]\n\n[If debts updated:]\nšŸ“ Active Debts:\n- [Person]: ₹[amount] ([Type])\n\nDate & time: ([date and time of logging])\n\nAll records updated successfully! šŸŽ‰\n```\n\n## Emojis\n\n**Transaction Types:** Expense šŸ’ø | Income šŸ’° | Borrowed šŸ”“ | Lent šŸ’š | Repaid āœ… | Owed āš ļø\n\n**Categories:** Food šŸ” | Travel šŸš— | Entertainment šŸŽ¬ | Utilities šŸ’” | Shopping šŸ›ļø | Health šŸ„ | Education šŸ“š | Other šŸ“¦\n\n## Error Handling\n\nFor any errors, send clear message and stop:\n- Unclear format → \"āŒ I couldn't parse your transactions. Use format: ₹500 cash food, ₹200 online travel\"\n- Missing person for debt → \"āŒ Debt transactions require a person's name. Example: borrowed ₹1000 from Rahul\"\n- Database errors → \"āŒ Error [reading/updating] records: [brief error]. Please try again.\"\n\n## Decision Flow\n\n```\nMessage received\n↓\nThink: Is this a transaction?\nā”œā”€ NO → Reply appropriately, end\n└─ YES → Parse & store in memory\n         ↓\n         Get current balances\n         ↓\n         Calculate new balances\n         ↓\n         Send preview & wait for approval\n         ↓\n         Think: Approved?\n         ā”œā”€ NO → Send cancellation, end\n         └─ YES → Update Transactions\n                  ↓\n                  Update Debts (if needed)\n                  ↓\n                  Update Balances\n                  ↓\n                  Send confirmation, end\n```\n\n## Key Reminders\n\n- Always use **Think** before decisions\n- Use **Postgres Chat Memory** to maintain conversation context\n- Use **Calculator** for all balance computations\n- Generate Transaction_ID for each transaction: \"TXN_{timestamp}_{index}\"\n- Timestamps are auto-handled by database\n- Every workflow path ends with **replying to the user**"
        },
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "7b79f453-efff-4379-a97c-ab60f9eaa22c",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        384,
        992
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "id": "",
          "name": "Google Gemini API"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "f70fe62b-4dde-4d1b-ad8a-52c9b3bf68dd",
      "name": "Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        736,
        992
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "46145479-41b7-4a08-b68d-fe7588b24076",
      "name": "Calculator",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        864,
        992
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "85be0e80-a596-4050-9944-b05b054e29b9",
      "name": "Get Balances",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1024,
        992
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "descriptionType": "manual",
        "toolDescription": "Get row(s) in Balances sheet from Google Sheets"
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "Google Sheets OAuth2"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "dacf868c-69e0-4390-a492-86737771f614",
      "name": "Get Transactions",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1152,
        992
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "descriptionType": "manual",
        "toolDescription": "Get row(s) in Transactions sheet from Google Sheets"
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "Google Sheets OAuth2"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "dd1bce62-897c-4bfa-ae16-26170bebff47",
      "name": "Get Debts",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1264,
        992
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "descriptionType": "manual",
        "toolDescription": "Get row(s) in Debts sheet from Google Sheets"
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "Google Sheets OAuth2"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "d049a7e5-0b2c-47db-a105-2f1d56d87174",
      "name": "Postgres Chat Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        528,
        992
      ],
      "parameters": {
        "tableName": "n8n_chat_history_finance",
        "sessionKey": "finance_tracker_session",
        "sessionIdType": "customKey"
      },
      "credentials": {
        "postgres": {
          "id": "",
          "name": "PostgreSQL"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "eebbfa56-66d8-4a5a-8249-94e724ef1b9b",
      "name": "replying to the user",
      "type": "n8n-nodes-base.slack",
      "position": [
        1504,
        688
      ],
      "parameters": {
        "text": "={{ $json.output }}",
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "otherOptions": {
          "includeLinkToWorkflow": false
        }
      },
      "credentials": {
        "slackApi": {
          "id": "",
          "name": "Slack API"
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "0dda1a8e-684c-4505-98f4-8cd92b67a85a",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        576
      ],
      "parameters": {
        "color": 4,
        "width": 1728,
        "height": 736,
        "content": "## Agent\nNote: Never trigger the flow with normal message, because then the flow will be triggered by it's own reply message creating an infinite loop.\nClaude is recommended as the model."
      },
      "typeVersion": 1
    },
    {
      "id": "ab928c87-9fac-459f-a5eb-8f4fa887d41b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        144
      ],
      "parameters": {
        "color": 5,
        "width": 1360,
        "height": 416,
        "content": "## Scheduled checkin"
      },
      "typeVersion": 1
    },
    {
      "id": "42e14b01-4f61-4191-96b8-87b8c8109910",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        144
      ],
      "parameters": {
        "width": 656,
        "height": 1168,
        "content": "# Personal Finance Tracker AI Agent\n\n## Overview\nAI-powered Slack bot that logs transactions, tracks debts, and manages balances in Google Sheets using natural language.\n\n## Key Features\n- šŸ¤– Natural language transaction parsing via Google Gemini\n- šŸ’° Automatic balance calculations (cash + online)\n- šŸ”„ Debt tracking (borrowed/lent/repaid)\n- āœ… Preview & approve before saving\n- šŸ“Š Daily automated check-ins at 11 PM\n- šŸ’¬ Conversational memory with PostgreSQL\n\n## How It Works\n\n**Daily Reminder (11 PM)**\n- Shows current balances & active debts\n- Prompts for today's transactions\n\n**Transaction Processing**\n1. Mention bot with transactions: `₹500 cash food, ₹200 online travel`\n2. AI parses & calculates new balances\n3. Shows preview for approval\n4. Updates Google Sheets after confirmation\n\n**Debt Handling**\n- `Borrowed ₹1000 from Rahul` → Balance +1000, tracks I_Owe\n- `Lent ₹500 to Priya` → Balance -500, tracks They_Owe_Me\n- `Rahul paid back ₹500` → Updates debt status to Settled\n\n## Data Structure (Google Sheets)\n- **Balances:** Date, Cash, Online, Total\n- **Transactions:** ID, Date, Amount, Type, Category, Person\n- **Debts:** Person, Amount, Type, Status, Notes\n\n## Prerequisites\n- Slack workspace + bot token\n- Google Sheets (3 tabs setup)\n- Google Gemini API key\n- PostgreSQL database\n- n8n instance"
      },
      "typeVersion": 1
    },
    {
      "id": "91e00b24-5e03-4d22-b2f5-618c59e3e0af",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        928
      ],
      "parameters": {
        "width": 368,
        "height": 208,
        "content": "## Retrieving data"
      },
      "typeVersion": 1
    },
    {
      "id": "ea0e38f5-dfde-4978-8957-6fb3017fb1dd",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1376,
        1072
      ],
      "parameters": {
        "width": 496,
        "height": 224,
        "content": "## Adding/Modifying data"
      },
      "typeVersion": 1
    },
    {
      "id": "638edc57-a081-42d8-b827-1a0f565b240c",
      "name": "Adding/updating Transactions",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1424,
        1120
      ],
      "parameters": {
        "columns": {
          "value": {
            "Date": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Date__using_to_match_', ``, 'string') }}",
            "Time": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Time', ``, 'string') }}",
            "Amount": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Amount', ``, 'string') }}",
            "Added_At": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Added_At', ``, 'string') }}",
            "Category": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Category', ``, 'string') }}",
            "Description": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Description', ``, 'string') }}",
            "Person_Name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Person_Name', ``, 'string') }}",
            "Payment_Type": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Payment_Type', ``, 'string') }}",
            "Transaction_ID": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Transaction_ID', ``, 'string') }}",
            "Transaction_Type": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Transaction_Type', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "Transaction_ID",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Transaction_ID",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Date",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Time",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Amount",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Payment_Type",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Payment_Type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Category",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Transaction_Type",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Transaction_Type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Person_Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Person_Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Description",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Description",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Added_At",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Added_At",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Transaction_ID"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "Google Sheets OAuth2"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "9a9078c6-5acc-42f5-b3f6-278c880e486a",
      "name": "Adding/updating debts",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1584,
        1120
      ],
      "parameters": {
        "columns": {
          "value": {
            "Type": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Type', ``, 'string') }}",
            "Notes": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Notes', ``, 'string') }}",
            "Amount": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Amount', ``, 'string') }}",
            "Status": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Status', ``, 'string') }}",
            "Person_Name": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Person_Name', ``, 'string') }}",
            "Date_created": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Date_created', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "Person_Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Person_Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Amount",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Type",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Type",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Date_created",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Date_created",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Notes",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Notes",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Person_Name"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "Google Sheets OAuth2"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "a74ad1ef-12c5-4713-a8e8-cde55d0c4f26",
      "name": "Adding/updating balances",
      "type": "n8n-nodes-base.googleSheetsTool",
      "position": [
        1744,
        1120
      ],
      "parameters": {
        "columns": {
          "value": {
            "Date": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Date__using_to_match_', ``, 'string') }}",
            "Cash_Balance": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Cash_Balance', ``, 'string') }}",
            "Total_Balance": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Total_Balance', ``, 'string') }}",
            "Online_Balance": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Online_Balance', ``, 'string') }}"
          },
          "schema": [
            {
              "id": "Date",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Cash_Balance",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Cash_Balance",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Online_Balance",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Online_Balance",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Total_Balance",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Total_Balance",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Date"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "",
          "name": "Google Sheets OAuth2"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "b3fd7483-685a-47ce-aace-6c81f2ee0eb1",
      "name": "Daily checkin trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        288,
        272
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 23
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "239a0c40-616e-44a3-94f5-13b33cae240e",
      "name": "Bot Mention trigger",
      "type": "n8n-nodes-base.slackTrigger",
      "position": [
        208,
        688
      ],
      "parameters": {
        "options": {},
        "trigger": [
          "app_mention"
        ],
        "channelId": {
          "__rl": true,
          "mode": "list",
          "value": ""
        }
      },
      "credentials": {
        "slackApi": {
          "id": "",
          "name": "Slack API"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1",
    "saveExecutionProgress": true
  },
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Format Daily Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Think": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "replying to the user",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Debts": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Calculator": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Balances": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get Active Debts": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get Transactions": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Bot Mention trigger": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Current Balance": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Daily Message": {
      "main": [
        [
          {
            "node": "Send Slack Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Adding/updating debts": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Daily checkin trigger": {
      "main": [
        [
          {
            "node": "Get Current Balance",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Active Debts",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Adding/updating balances": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Adding/updating Transactions": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}

ē›øå…³å·„ä½œęµ