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": "Valid AI Agent Workflow",
"nodes": [
{
"id": "a1000000-0000-0000-0000-000000000001",
"name": "Chat Trigger",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
240,
300
],
"parameters": {
"path": "chat",
"responseMode": "lastNode"
}
},
{
"id": "a1000000-0000-0000-0000-000000000002",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1,
"position": [
460,
300
],
"parameters": {
"systemMessage": "You are a helpful assistant.",
"options": {}
}
},
{
"id": "a1000000-0000-0000-0000-000000000003",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1,
"position": [
460,
480
],
"parameters": {
"model": "gpt-4o-mini",
"options": {}
},
"retryOnFail": true,
"credentials": {
"lmChatOpenAiApi": {
"name": "<your credential>"
}
}
},
{
"id": "a1000000-0000-0000-0000-000000000004",
"name": "Window Buffer Memory",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1,
"position": [
640,
480
],
"parameters": {
"sessionKey": "={{ $json.sessionId }}",
"contextWindowLength": 10
}
}
],
"connections": {
"Chat Trigger": {
"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
}
]
]
}
},
"settings": {},
"staticData": null
}
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.
lmChatOpenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
Valid AI Agent Workflow. Uses agent, lmChatOpenAi, memoryBufferWindow. Webhook trigger; 4 nodes.
Source: https://github.com/AutomateLab-tech/n8n-mcp/blob/main/eval/workflows/valid-ai-agent.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.