{
  "name": "Financeiro",
  "nodes": [
    {
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "Mensagem"
            },
            {
              "name": "ChatID"
            }
          ]
        }
      },
      "id": "c055762a-8fe7-4141-a639-df2372f30060",
      "typeVersion": 1.1,
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        272,
        352
      ]
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "=",
        "options": {
          "systemMessage": "=# Identidade\nVoc\u00ea \u00e9 a Bia, Analista Financeira da Hashtag Capital.\nSeu tom \u00e9: Emp\u00e1tico, Colaborativo e Atencioso. Escreva como um parceiro de neg\u00f3cios que quer ajudar, focando na solu\u00e7\u00e3o e n\u00e3o apenas na cobran\u00e7a/regra.\n\n# Contexto Temporal\nA data e hora exata de hoje \u00e9: {{ $now }}.\nUse para verificar vencimentos de boletos.\n\n# Sua Ferramenta Principal\nVoc\u00ea tem acesso \u00e0 tool `consultar_status_cliente`.\nUse-a sempre que o aluno perguntar sobre Pagamentos em aberto, boletos, segunda via.\n\n# Instru\u00e7\u00f5es de Opera\u00e7\u00e3o\n1. Coleta de dados. Pe\u00e7a o nome e e-mail do cliente para confer\u00eancia\n2. Consulta: Chame a tool enviando o E-mail do cliente.\n3. An\u00e1lise do Retorno:\n   - Se \"Sem Pend\u00eancias\": \"Sua conta est\u00e1 regular e sem pend\u00eancias financeiras.\"\n   - Se \"Pendente\": \"Aqui est\u00e1 o link para pagamento da fatura\"\n   - Se o cliente quiser a segunda via (independente de regularizado ou pendente): \u201cAqui est\u00e1 o link da 2a via do seu boleto\u201d\n\n# Regra de Seguran\u00e7a\nNunca invente informa\u00e7\u00f5es. Baseie-se estritamente no retorno da ferramenta.\n\n# REGRA DE TEXTO (IMPORTANTE)\nVoc\u00ea est\u00e1 em um chat simples que quebra se receber c\u00f3digos.\n1. Escreva como se fosse um bloco de notas simples.\n2. NUNCA use negrito, it\u00e1lico, asteriscos ou c\u00f3digos de formata\u00e7\u00e3o.\n\n\n# Regra de sa\u00edda\nSe o assunto for SUPORTE T\u00c9CNICO (App/D\u00favidas) ou CS (Investir/Agendar), responda apenas:\n##RESET##\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3,
      "position": [
        480,
        352
      ],
      "id": "9f21b9d5-d0d9-48e9-a7b4-112490666cc2",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.ChatID }}",
        "contextWindowLength": 30
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        576,
        624
      ],
      "id": "acabb540-b76b-477c-b20b-5a8f56b6a7fb",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "documentId": {
          "__rl": true,
          "value": "1emBcwKoIDiT9nTEfEPfcOBSZJrzLlyw0Pcm30W6Kf6U",
          "mode": "list",
          "cachedResultName": "TESTE",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1emBcwKoIDiT9nTEfEPfcOBSZJrzLlyw0Pcm30W6Kf6U/edit?usp=drivesdk"
        },
        "sheetName": {
          "__rl": true,
          "value": 1414155178,
          "mode": "list",
          "cachedResultName": "Financeiro",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1emBcwKoIDiT9nTEfEPfcOBSZJrzLlyw0Pcm30W6Kf6U/edit#gid=1414155178"
        },
        "filtersUI": {
          "values": [
            {
              "lookupColumn": "E-mail Cliente",
              "lookupValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('values0_Value', `Use o e-mail que o cliente forneceu para confer\u00eancia de dados`, 'string') }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleSheetsTool",
      "typeVersion": 4.7,
      "position": [
        864,
        624
      ],
      "id": "2d4353a3-e789-4cd3-96f7-d9627526f6ee",
      "name": "Get row(s) in sheet in Google Sheets",
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-3.5-turbo",
          "mode": "list",
          "cachedResultName": "gpt-3.5-turbo"
        },
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [
        352,
        560
      ],
      "id": "1bdd2501-001d-4647-b13d-a6a080273345",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "AGENTE FINANCEIRO",
        "height": 608,
        "width": 864,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        240
      ],
      "typeVersion": 1,
      "id": "371ebcf0-0695-4f4a-8079-e57de3b47fb6",
      "name": "Sticky Note"
    }
  ],
  "connections": {
    "When Executed by Another Workflow": {
      "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
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8cd02ae2-7239-4aae-bf27-2c853cbb42c1",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "ldae735ArP01bg9v",
  "tags": []
}