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 →
{
"name": "n8n_workflow",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "on_message",
"responseMode": "responseNode",
"options": {}
},
"type": "n8n-nodes-base.webhook",
"typeVersion": 2.1,
"position": [
-1376,
720
],
"id": "55c1ec7f-3d1e-420f-bcee-f4eeff2e216a",
"name": "Webhook1"
},
{
"parameters": {
"respondWith": "json",
"responseBody": "={{ {\n reply: $json.output\n} }}",
"options": {}
},
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.4,
"position": [
-336,
720
],
"id": "b5c9e58d-c9aa-424a-912b-163eb8791408",
"name": "Respond to Webhook"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "61c4137a-299b-4ae0-98c6-933d32821633",
"name": "sessionId",
"value": "={{$json.body.caller}}",
"type": "string"
},
{
"id": "6da0822b-e05f-4e85-9f57-a03e841b4fea",
"name": "chatInput",
"value": "={{ $json.body.text }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-1040,
720
],
"id": "c823ffe7-41af-4454-9739-079db9bce181",
"name": "Edit Fields (Set)"
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"typeVersion": 1.3,
"position": [
-1376,
496
],
"id": "6fa5b7a2-13c0-4a69-9129-70e4cc4889ba",
"name": "When chat message received"
},
{
"parameters": {
"method": "POST",
"url": "http://changeme:8099/call",
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={\n \"callerId\": \"01234567\",\n \"message\": \"{{$json.chatInput}}\"\n}",
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.2,
"position": [
-1120,
496
],
"id": "9fc9a859-aead-4f05-8fd8-c5bde41bf76b",
"name": "HTTP Request"
},
{
"parameters": {
"hasOutputParser": true,
"options": {
"systemMessage": ""
}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 2.2,
"position": [
-752,
720
],
"id": "c30f46a5-ef3a-4819-8453-b2832aaaf9da",
"name": "AI Agent1",
"executeOnce": true
},
{
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4.1-mini"
},
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1.2,
"position": [
-800,
944
],
"id": "a556388c-47bb-4a8e-af8c-05daea74f92b",
"name": "OpenAI Chat Model1",
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {},
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1.3,
"position": [
-656,
976
],
"id": "787fb82f-9c5b-4bf2-a614-1a6e92f639b9",
"name": "Simple Memory1"
}
],
"connections": {
"Webhook1": {
"main": [
[
{
"node": "Edit Fields (Set)",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields (Set)": {
"main": [
[
{
"node": "AI Agent1",
"type": "main",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "HTTP Request",
"type": "main",
"index": 0
}
]
]
},
"AI Agent1": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "AI Agent1",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Simple Memory1": {
"ai_memory": [
[
{
"node": "AI Agent1",
"type": "ai_memory",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "94c5b42e-5b2e-4fbd-8730-9c636023273b",
"id": "XYfcLjTGIIZc3k0x",
"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.
openAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
n8n_workflow. Uses chatTrigger, httpRequest, agent, lmChatOpenAi. Webhook trigger; 8 nodes.
Source: https://github.com/dohren/fritz-ai-assistant/blob/47210c68b5fe86f5b3338c091d9a9cb862fef104/examples/n8n_workflow.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.
Create A Branded Ai-Powered Website Chatbot. Uses memoryBufferWindow, respondToWebhook, lmChatOpenAi, toolHttpRequest. Webhook trigger; 24 nodes.
Code Respondtowebhook. Uses memoryBufferWindow, respondToWebhook, lmChatOpenAi, toolHttpRequest. Webhook trigger; 24 nodes.
Engage website visitors with an intelligent chat widget powered by OpenAI. This template includes: 💬 Natural conversation handling 📅 Microsoft Outlook calendar integration 📝 Lead capture and informati
Transform your n8n workflows into OpenAI-compatible API endpoints, allowing you to access multiple workflows as selectable AI models through a single integration.
This workflow transforms WhatsApp into a powerful personal AI using n8n + Green-API. Send text or voice messages — the assistant understands intent and handles daily tasks automatically. 💰 Expense & i