{
  "name": "AI: conversational agent with custom tool written in JavaScript",
  "nodes": [
    {
      "id": "912b279c-30e5-4991-92ab-040fc1e89c7a",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -60,
        0
      ]
    },
    {
      "id": "749d8762-d213-4dd3-b404-4c6518fcd28f",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -60,
        200
      ]
    },
    {
      "id": "1eeff044-b914-40f7-8d37-8b69007862cd",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        460,
        0
      ]
    },
    {
      "id": "ac34f7f0-d1dc-4ffb-8f49-6ddc925e97bc",
      "name": "Debug Input",
      "type": "n8n-nodes-base.set",
      "position": [
        160,
        0
      ]
    },
    {
      "id": "a410a0a5-1ea1-4ade-a32c-8f6fd959bae8",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        440,
        200
      ]
    },
    {
      "id": "923b1597-2e9c-4c38-b3bb-7d6dffb52e4a",
      "name": "Code Tool",
      "type": "@n8n/n8n-nodes-langchain.toolCode",
      "position": [
        660,
        200
      ]
    }
  ],
  "connections": {
    "Code Tool": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Debug Input": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Debug Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}