{
  "name": "Comp_Company_Chatbot_V3",
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        -540,
        -100
      ],
      "id": "35bc075e-53bc-4c57-b86a-71b6f3bd7915",
      "name": "When chat message received"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.chatInput }}",
        "options": {
          "systemMessage": "You represent a Computer company. Please answer customer inquiries using the information provided in the Google Sheet. Please send an email to the owner only if the customer requests to purchase a device. Before sending the email, ask the customer for their name and phone number, and send them to the owner via Email."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2,
      "position": [
        -240,
        -100
      ],
      "id": "1041b2f2-d3ac-4d2a-8ae2-879bd02f6158",
      "name": "AI Agent"
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        -140,
        120
      ],
      "id": "e666aa36-1405-46cc-a08e-8745c9e8a899",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1gkBZNwtyq3a_OZA0_V40tlHXcDKGjBlOB0oCZ0447bw",
          "mode": "list",
          "cachedResultName": "V1_Company_DataBase",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gkBZNwtyq3a_OZA0_V40tlHXcDKGjBlOB0oCZ0447bw/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "Sheet1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1gkBZNwtyq3a_OZA0_V40tlHXcDKGjBlOB0oCZ0447bw/edit#gid=0"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.6,
      "position": [
        40,
        140
      ],
      "id": "7bc2e378-16ae-43d1-ad09-b321bd1ba489",
      "name": "Get row(s) in sheet in Google Sheets",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sendTo": "mramelshamy408@gmail.com",
        "subject": "Customer Purchase Request",
        "emailType": "text",
        "message": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Message', ``, 'string') }}",
        "options": {}
      },
      "type": "n8n-nodes-base.gmailTool",
      "typeVersion": 2.1,
      "position": [
        240,
        60
      ],
      "id": "e403f235-3766-4fd2-b95b-ecb77485f32d",
      "name": "Send a message in Gmail",
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": "grok-4-0709",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok",
      "typeVersion": 1,
      "position": [
        -420,
        120
      ],
      "id": "f6de7cca-6c76-45c2-9d45-ca7f94c31852",
      "name": "xAI Grok Chat Model",
      "credentials": {
        "xAiApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "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
          }
        ]
      ]
    },
    "Send a message in Gmail": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "xAI Grok Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e13d6e98-0fa7-44e8-82af-741f939a8c58",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "zqTYWHsUCcFhDkmm",
  "tags": []
}