This workflow follows the Agent → OpenAI Chat 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 →
{
"name": "AI agent with memory (webhook chat)",
"nodes": [
{
"id": "a1b2c3d4-0001-4ec6-9000-aaaaaaaaaaaa",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
240,
300
],
"parameters": {
"httpMethod": "POST",
"path": "chat",
"responseMode": "responseNode",
"options": {}
}
},
{
"id": "a1b2c3d4-0002-4ec6-9000-aaaaaaaaaaaa",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1.7,
"position": [
460,
300
],
"parameters": {
"options": {
"systemMessage": "You are a helpful assistant. Answer the user's question concisely."
}
}
},
{
"id": "a1b2c3d4-0003-4ec6-9000-aaaaaaaaaaaa",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1.2,
"position": [
340,
480
],
"parameters": {
"model": "gpt-4o-mini",
"options": {}
}
},
{
"id": "a1b2c3d4-0004-4ec6-9000-aaaaaaaaaaaa",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1.3,
"position": [
580,
480
],
"parameters": {
"contextWindowLength": 10
}
},
{
"id": "a1b2c3d4-0005-4ec6-9000-aaaaaaaaaaaa",
"name": "Respond to Webhook",
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.1,
"position": [
700,
300
],
"parameters": {
"respondWith": "json",
"responseBody": "={{ { \"reply\": $json.output } }}",
"options": {}
}
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Respond to Webhook",
"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
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
AI agent with memory (webhook chat). Uses agent, lmChatOpenAi, memoryBufferWindow. Webhook trigger; 5 nodes.
Source: https://github.com/AutomateLab-tech/n8n-mcp/blob/main/examples/workflow-ai-agent-webhook.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
AI chatbot for appointment scheduling. Uses memoryBufferWindow, lmChatOpenAi, toolWorkflow, chatTrigger. Webhook trigger; 12 nodes.
InstaTest. Uses memoryBufferWindow, lmChatOpenAi, respondToWebhook, stickyNote. Webhook trigger; 11 nodes.
Once connected, GPT will automatically initiate conversations with messages from new recipients in Intagram.
A natural conversational AI chatbot that collects lead information (Name, Phone, Email, Message) one question at a time without feeling like a form. Uses session-based memory to track conversations, i
Read - Automação de Reunião. Uses agent, lmChatOpenAi, memoryBufferWindow, googleDocsTool. Webhook trigger; 9 nodes.