Skip to content

Problem in node ‘Test‘ A Chat Model sub-node must be connected and enabled #1

@marcelinhov2

Description

@marcelinhov2

Hey, thanks for this incredible node.

I'm trying to use it with Agent AI, but I'm always getting this error: Problem in node ‘Test‘ A Chat Model sub-node must be connected and enabled

Do you have any idea what I'm missing here?

{
  "nodes": [
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $('Seta Mensagem para o Agente').item.json.message }}",
        "options": {
          "systemMessage": "={{ ($('Get Prompt').item.json.data.getPersonalAssistantByPriority.finalPrompt || $('Get Prompt').item.json.data.getPersonalAssistantByPriority.prompt).replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\t/g, '\\t') }}"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        6528,
        2128
      ],
      "id": "4b9832dc-d9bc-4655-bc2c-f76fd941a44e",
      "name": "AI Agent",
      "alwaysOutputData": true
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        6448,
        2336
      ],
      "id": "efac7359-18ea-4001-9cf0-a1fb138f6a19",
      "name": "OpenAI Chat Model",
      "credentials": {
        "{{ $('Get Prompt').item.json.data.getPersonalAssistantByPriority.effectiveCredentials.n8nCredentialType }}": {
          "id": "{{ $('Get Prompt').item.json.data.getPersonalAssistantByPriority.effectiveCredentials.n8nCredentialId || "PxkyvxybHJtc1zpn" }}",
          "name": "OpenAi Calendar"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $('Variáveis do Fluxo').item.json.IdConversa }}",
        "sessionTTL": 604800,
        "contextWindowLength": 100
      },
      "type": "@n8n/n8n-nodes-langchain.memoryRedisChat",
      "typeVersion": 1.5,
      "position": [
        6592,
        2336
      ],
      "id": "ebfd5e62-c6ad-4824-beb9-4c5dfa888b3e",
      "name": "Redis Chat Memory",
      "credentials": {
        "redis": {
          "id": "tnrw3ThzG7MR5uJY",
          "name": "Redis N8N"
        }
      }
    }
  ],
  "connections": {
    "AI Agent": {
      "main": [
        []
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Redis Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "meta": {
    "instanceId": "61bbfe9001b141c42b776af4ffb216045790e5125aca4d5977e46d0ed571e47f"
  }
}

NodeOperationError: A Chat Model sub-node must be connected and enabled at validateInputConfiguration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions