This workflow corresponds to n8n.io template #4012 — we link there as the canonical source.
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 →
{
"id": "WwEFqNK4YP6UJcg2",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Auto Knowledge Base Article Generator",
"tags": [],
"nodes": [
{
"id": "17900021-8da3-4bd9-9d79-5d20d879ddc7",
"name": "Create Perplexity Content",
"type": "n8n-nodes-base.httpRequest",
"position": [
1220,
380
],
"parameters": {},
"typeVersion": 4.2
},
{
"id": "0cb3f3a7-92bd-4ff3-8a89-b6fc29513e65",
"name": "AI Writer Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
720,
380
],
"parameters": {},
"typeVersion": 1.7
},
{
"id": "bc62facb-c5cb-465d-89b1-a65a893c3ce1",
"name": "AI Editor Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
2280,
380
],
"parameters": {},
"retryOnFail": true,
"typeVersion": 1.7
},
{
"id": "8c08d67a-b916-4cfd-89cd-16b34250bcb2",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
680,
640
],
"parameters": {},
"typeVersion": 1.2
},
{
"id": "97bb1374-f502-4152-a5a3-bc5d46a18171",
"name": "OpenAI Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
2200,
660
],
"parameters": {},
"typeVersion": 1.2
},
{
"id": "1c422e76-5b1a-4615-b379-ab39d4bd13b4",
"name": "Accept and Publish",
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"position": [
2420,
660
],
"parameters": {},
"typeVersion": 2
},
{
"id": "b6807e84-900a-48fc-a869-862824c62ba1",
"name": "When chat message received",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-60,
660
],
"parameters": {},
"typeVersion": 1.1
},
{
"id": "e3021ac4-9444-4689-af0c-a4bbd4729c35",
"name": "JSON.parse1",
"type": "n8n-nodes-base.code",
"position": [
1320,
120
],
"parameters": {},
"typeVersion": 2
},
{
"id": "d6a5eccd-c8e3-4ee0-beb0-7b8fc8428b91",
"name": "Merge",
"type": "n8n-nodes-base.merge",
"position": [
1840,
380
],
"parameters": {},
"typeVersion": 3
},
{
"id": "8461a1a0-a984-4ec1-bc93-3a1a312caf55",
"name": "Format",
"type": "n8n-nodes-base.code",
"position": [
2060,
380
],
"parameters": {},
"typeVersion": 2
},
{
"id": "9b9a82fb-990c-4be0-aee9-ed80f0631c28",
"name": "JSON.parse",
"type": "n8n-nodes-base.code",
"position": [
3300,
840
],
"parameters": {},
"typeVersion": 2
},
{
"id": "066dfd10-e97a-44a8-89e0-5b2b5c4a6244",
"name": "Format Perplexity Output & Add Citations",
"type": "n8n-nodes-base.code",
"position": [
1480,
380
],
"parameters": {},
"typeVersion": 2
},
{
"id": "fc9d9e93-568a-41af-a295-8736617b157e",
"name": "Initialize Count",
"type": "n8n-nodes-base.set",
"position": [
340,
660
],
"parameters": {},
"typeVersion": 1
},
{
"id": "b0e636dd-f572-4ee2-832f-4bb4167b011b",
"name": "Increment Count",
"type": "n8n-nodes-base.function",
"position": [
1400,
740
],
"parameters": {},
"typeVersion": 1
},
{
"id": "86689f0e-9607-4eda-bcd6-36241d0cbe63",
"name": "Check Limit",
"type": "n8n-nodes-base.if",
"position": [
2660,
380
],
"parameters": {},
"typeVersion": 1
},
{
"id": "0f42b0f3-0b96-40df-9c06-2a6d31e142d9",
"name": "Stop Here",
"type": "n8n-nodes-base.noOp",
"position": [
2980,
300
],
"parameters": {},
"typeVersion": 1
},
{
"id": "1e61b3ba-e9bd-43c7-8217-d4a22f707318",
"name": "Execute Workflow",
"type": "n8n-nodes-base.executeWorkflow",
"position": [
3680,
320
],
"parameters": {},
"typeVersion": 1.2
},
{
"id": "04526224-e48c-4032-9c92-475c6bf9cd0a",
"name": "JSON.parse3",
"type": "n8n-nodes-base.code",
"position": [
3280,
300
],
"parameters": {},
"typeVersion": 2
},
{
"id": "0303ab91-b788-4074-a15d-239565528dec",
"name": "should submit",
"type": "n8n-nodes-base.if",
"position": [
2980,
680
],
"parameters": {},
"typeVersion": 2.2
},
{
"id": "4f68e1ad-0b7c-41ca-a9cc-d220017cc1bd",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
540,
80
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "f5e9968a-0681-4b72-9bb3-98750f55565e",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
2620,
120
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "462e6c9a-162a-4f66-b846-14b29517454c",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
2120,
160
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "27149a0a-ab95-4f73-a20c-34167ac56d2a",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
3520,
60
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "3b6386cc-7965-47ae-88e3-8841ada43579",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
-220,
-180
],
"parameters": {
"content": ""
},
"typeVersion": 1
},
{
"id": "376c9b0d-8ef6-4681-900d-745d4353cc83",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
3520,
580
],
"parameters": {
"content": ""
},
"typeVersion": 1
}
],
"active": true,
"settings": {
"callerPolicy": "workflowsFromSameOwner",
"errorWorkflow": "AKus9UvKRJfvTZBA",
"executionOrder": "v1",
"executionTimeout": 1800
},
"versionId": "b4259335-d41f-4671-b103-5b4e9609089b",
"connections": {
"Merge": {
"main": [
[
{
"node": "Format",
"type": "main",
"index": 0
}
]
]
},
"Format": {
"main": [
[
{
"node": "AI Editor Agent",
"type": "main",
"index": 0
}
]
]
},
"Stop Here": {
"main": [
[
{
"node": "JSON.parse3",
"type": "main",
"index": 0
}
]
]
},
"JSON.parse": {
"main": [
[
{
"node": "AI Writer Agent",
"type": "main",
"index": 0
},
{
"node": "Increment Count",
"type": "main",
"index": 0
}
]
]
},
"Check Limit": {
"main": [
[
{
"node": "Stop Here",
"type": "main",
"index": 0
}
],
[
{
"node": "should submit",
"type": "main",
"index": 0
}
]
]
},
"JSON.parse1": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"JSON.parse3": {
"main": [
[
{
"node": "Execute Workflow",
"type": "main",
"index": 0
}
]
]
},
"should submit": {
"main": [
[
{
"node": "JSON.parse3",
"type": "main",
"index": 0
}
],
[
{
"node": "JSON.parse",
"type": "main",
"index": 0
}
]
]
},
"AI Editor Agent": {
"main": [
[
{
"node": "Check Limit",
"type": "main",
"index": 0
}
]
]
},
"AI Writer Agent": {
"main": [
[
{
"node": "Create Perplexity Content",
"type": "main",
"index": 0
},
{
"node": "JSON.parse1",
"type": "main",
"index": 0
}
]
]
},
"Increment Count": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 2
}
]
]
},
"Initialize Count": {
"main": [
[
{
"node": "AI Writer Agent",
"type": "main",
"index": 0
},
{
"node": "Increment Count",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Writer Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Accept and Publish": {
"ai_tool": [
[
{
"node": "AI Editor Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenAI Chat Model1": {
"ai_languageModel": [
[
{
"node": "AI Editor Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Create Perplexity Content": {
"main": [
[
{
"node": "Format Perplexity Output & Add Citations",
"type": "main",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "Initialize Count",
"type": "main",
"index": 0
}
]
]
},
"Format Perplexity Output & Add Citations": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow was created by Varritech Technologies, an innovative agency that leverages AI to engineer, design, and deliver software development projects 500% faster than traditional agencies. Based in New York City, we specialize in custom software development, web…
Source: https://n8n.io/workflows/4012/ — 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.
by Varritech Technologies
Airtable AI Agent. Uses lmChatOpenAi, agent, toolWorkflow, toolCode. Chat trigger; 42 nodes.
Ai Agent To Chat With Airtable And Analyze Data. Uses lmChatOpenAi, agent, stickyNote, memoryBufferWindow. Chat trigger; 41 nodes.
I prepared a detailed guide that shows the entire process of building an AI agent that integrates with Airtable data in n8n. This template covers everything from data preparation to advanced configura
✨📊Multi-AI Agent Chatbot for Postgres/Supabase DB and QuickCharts + Tool Router. Uses chatTrigger, postgresTool, executeWorkflowTrigger, toolWorkflow. Chat trigger; 40 nodes.