{
  "name": "Chat With Google Sheets",
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.4,
      "position": [
        -320,
        -64
      ],
      "id": "ea57d782-9a16-4011-8fa0-ef2b71caa489",
      "name": "When chat message received",
      "webhookId": "bbf95c8e-3a40-4477-863f-f0c0afd4564f"
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "You are a data analyst. When user asks a question, \ncall the read_google_sheet tool, analyze the data, \nand give a clear answer with numbers.\nOnly use data returned by the tool. Do not make anything up."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        -112,
        -64
      ],
      "id": "2de9a9ec-7cdf-4cba-81f1-d1a10e67d713",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('When chat message received').item.json.sessionId }}",
        "contextWindowLength": 10
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        16,
        224
      ],
      "id": "c32868f8-aa7a-4a3d-9ca4-599f55c19776",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "descriptionType": "manual",
        "toolDescription": "Use this tool to read all company data from the Google Sheet. \nReturns all rows with all columns.",
        "documentId": {
          "__rl": true,
          "value": "1M8YNJCzrnC0TMQhPUE3yH9w2RPVVlt3NFl3xYsPipL0",
          "mode": "list",
          "cachedResultName": "NexScope Pricing",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1M8YNJCzrnC0TMQhPUE3yH9w2RPVVlt3NFl3xYsPipL0/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1M8YNJCzrnC0TMQhPUE3yH9w2RPVVlt3NFl3xYsPipL0/edit#gid=0"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.7,
      "position": [
        160,
        160
      ],
      "id": "7e2d8d87-e5f3-4fe4-82c0-dec7c3bb602a",
      "name": "Get row(s) in sheet in Google Sheets",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "oGVxOBAjYbqnoZ8r",
          "name": "Google Sheets account"
        }
      }
    },
    {
      "parameters": {
        "options": {
          "temperature": 0.4
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        -192,
        192
      ],
      "id": "06fa706d-7963-4cf0-a291-35ad3b0db498",
      "name": "Google Gemini Chat Model",
      "credentials": {
        "googlePalmApi": {
          "id": "2zVpNR89JwCCuoiY",
          "name": "Google Gemini(PaLM) Api account"
        }
      }
    }
  ],
  "pinData": {},
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet in Google Sheets": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "ff4dfcb1-0e99-4cd1-84ad-ef7cf7ed6138",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "2f2acbb4671f75363fc924c3ee857e4c66b40b7c71f9d6722f8af3a2e26fe73e"
  },
  "id": "yut94FwlglNPkwhd",
  "tags": []
}