{
  "name": "Case 1",
  "nodes": [
    {
      "parameters": {
        "public": true,
        "initialMessages": "Ol\u00e1! \ud83d\udc4b\nMeu nome \u00e9 Miumiu. Como posso te ajudar hoje?",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        0,
        0
      ],
      "id": "ed7095a2-01f0-4b04-a39a-de6e9d870606",
      "name": "When chat message received"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "85020674-e50c-4437-b011-4d02d62ed22e",
              "name": "idConversa",
              "value": "={{ $json.sessionId }}",
              "type": "string"
            },
            {
              "id": "24b6c8eb-0a73-4ef5-8e12-86840920dac5",
              "name": "Mensagem",
              "value": "={{ $json.chatInput }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        220,
        0
      ],
      "id": "729c8720-61a6-43e3-82a5-d033479e6fcd",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "value": "1LQ2IGbZgz-dHcTBKp2yOPCdHFKJJwIFR8NNkMoYAAoU",
          "mode": "list",
          "cachedResultName": "NBN",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1LQ2IGbZgz-dHcTBKp2yOPCdHFKJJwIFR8NNkMoYAAoU/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": "gid=0",
          "mode": "list",
          "cachedResultName": "case 1",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1LQ2IGbZgz-dHcTBKp2yOPCdHFKJJwIFR8NNkMoYAAoU/edit#gid=0"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "idConversa": "={{ $json.idConversa }}",
            "Mensagem": "={{ $json.Mensagem }}"
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "idConversa",
              "displayName": "idConversa",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "Mensagem",
              "displayName": "Mensagem",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        440,
        0
      ],
      "id": "4a32982e-31b8-438a-bbcf-8014de802cbb",
      "name": "Google Sheets",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $('Edit Fields').item.json.Mensagem }}",
        "options": {
          "systemMessage": "Voc\u00ea \u00e9 um super agente de suporte, seja educado, engra\u00e7ado e utilize emojis em suas respostas para deixar a conversa mais humanizada "
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.9,
      "position": [
        660,
        0
      ],
      "id": "d82c8683-6d63-44ea-bfd1-ae8e6ee6e567",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "typeVersion": 1,
      "position": [
        580,
        180
      ],
      "id": "86b88fb2-1c99-4c9a-8651-187ad8cd0dd7",
      "name": "Groq Chat Model",
      "credentials": {
        "groqApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Edit Fields').item.json.idConversa }}"
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        700,
        180
      ],
      "id": "933ebc9f-16ba-496a-80a0-04afece8e193",
      "name": "Simple Memory"
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "typeVersion": 1,
      "position": [
        920,
        160
      ],
      "id": "42a3c3fa-5b3e-45c0-b225-95d377ee0695",
      "name": "Calculator"
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.toolWikipedia",
      "typeVersion": 1,
      "position": [
        820,
        180
      ],
      "id": "08293b34-5c30-4e04-9396-95175f812969",
      "name": "Wikipedia"
    },
    {
      "parameters": {},
      "type": "n8n-nodes-base.noOp",
      "typeVersion": 1,
      "position": [
        1020,
        0
      ],
      "id": "a6e02185-aca6-41ef-84b6-b70964a9c2f3",
      "name": "No Operation, do nothing"
    }
  ],
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Groq Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Calculator": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Wikipedia": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ca04384f-356c-4849-8e82-e09de389f1a7",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "BUeHB9RsVkMPR1aB",
  "tags": []
}