AutomationFlowsAI & RAG › AI Chat Agent with OpenAI & Tools

AI Chat Agent with OpenAI & Tools

Original n8n title: AI Agent 1

AI Agent 1. Uses chatTrigger, agent, lmChatOpenAi, memoryBufferWindow. Chat trigger; 6 nodes.

Chat trigger trigger★★☆☆☆ complexityAI-powered6 nodesChat TriggerAgentOpenAI ChatMemory Buffer WindowTool CalculatorTool Wikipedia
AI & RAG Trigger: Chat trigger Nodes: 6 Complexity: ★★☆☆☆ AI nodes: yes Added:

This workflow follows the Agent → Chat Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "AI Agent 1",
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        0,
        0
      ],
      "id": "c5111dc7-d066-4d7e-a4f4-51d53611654e",
      "name": "When chat message received"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        220,
        0
      ],
      "id": "1dc0e0ab-3266-4a88-8af6-d91d02280e47",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        40,
        220
      ],
      "id": "15231a3a-9d17-4c5d-99cc-f74ba0503044",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        160,
        220
      ],
      "id": "dab6428a-4694-42b9-a8ab-f9b20bc16052",
      "name": "Window Buffer Memory"
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "typeVersion": 1,
      "position": [
        280,
        220
      ],
      "id": "f8e505a4-9cb1-4a8f-b1ba-24ce65f4588b",
      "name": "Calculator"
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.toolWikipedia",
      "typeVersion": 1,
      "position": [
        400,
        220
      ],
      "id": "c919cfe7-99d3-4ac5-83ea-41d1ae1355bb",
      "name": "Wikipedia"
    }
  ],
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer 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
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "da161b41-7117-4933-8087-5c9778bf13de",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "UPZFOl0STgV8nHNF",
  "tags": []
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

AI Agent 1. Uses chatTrigger, agent, lmChatOpenAi, memoryBufferWindow. Chat trigger; 6 nodes.

Source: https://github.com/Zie619/n8n-workflows — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Agent_2. Uses chatTrigger, agent, lmChatOpenAi, toolWikipedia. Chat trigger; 7 nodes.

Chat Trigger, Agent, OpenAI Chat +4
AI & RAG

✨ Intro This workflow shows how to go beyond a “plain” AI chatbot by:

Telegram, OpenAI, OpenAI Chat +13
AI & RAG

This template is for users who want to combine the power of AI with Google Sheets for managing and calculating data quickly. It’s ideal for small businesses, data entry teams, and anyone who tracks li

Chat Trigger, Agent, Memory Buffer Window +3
AI & RAG

Ernest AI. Uses gmailTool, lmChatOpenAi, clickUpTool, chatTrigger. Chat trigger; 11 nodes.

Gmail Tool, OpenAI Chat, Click Up Tool +6
AI & RAG

Report. Uses chatTrigger, googleSheetsTool, memoryBufferWindow, googleBigQueryTool. Chat trigger; 10 nodes.

Chat Trigger, Google Sheets Tool, Memory Buffer Window +5