This workflow corresponds to n8n.io template #17330 — we link there as the canonical source.
This workflow follows the Agent → Gmail 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": "JvFJ2REOLcJvdEj4",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Knowledge Base Article Generator Workflow (Procurement Industry)",
"tags": [],
"nodes": [
{
"id": "5b51bfdc-ac6b-436d-b910-471da910897d",
"name": "Workflow Overview",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1488,
704
],
"parameters": {
"width": 1388,
"height": 524,
"content": "## Knowledge Base Article Generator\n\n### How it works\n\nThis workflow collects resolved procurement tickets and chatbot queries, groups similar issues into common topics, and uses AI to generate knowledge base articles. Each article is tailored to the appropriate audience, routed for human approval, and then published and logged for future reference.\n\n### Setup steps\n\n1. Connect your Groq credential for all AI nodes.\n2. Connect Gmail OAuth2 for approval and notification emails.\n3. Connect Google Sheets for article storage and reporting.\n4. Replace the sample ticket and chatbot APIs with your own data sources.\n5. Update the approval recipient email address.\n6. Test the workflow with sample data before enabling the schedule.\n"
},
"typeVersion": 1
},
{
"id": "91d6f91d-01c8-42a5-8be7-ce440180efda",
"name": "Section: Data Collection",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1488,
1360
],
"parameters": {
"color": 7,
"width": 1420,
"height": 604,
"content": "## Issue Collection & Clustering\nRetrieves procurement support requests, normalizes the data, and clusters similar issues into reusable knowledge topics for AI analysis and article generation."
},
"typeVersion": 1
},
{
"id": "cf217f6a-1714-4db2-aea6-31010d0752e1",
"name": "Section: AI Analysis & Drafting",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
1152
],
"parameters": {
"color": 7,
"width": 1952,
"height": 844,
"content": "### AI Analysis & Article Creation\nIdentifies recurring procurement issues, generates structured knowledge articles, adds metadata, and validates AI output to prevent incomplete or failed drafts from moving forward."
},
"typeVersion": 1
},
{
"id": "7a300b46-81b7-4275-82d5-004013586236",
"name": "Section: Audience & Approval",
"type": "n8n-nodes-base.stickyNote",
"position": [
2032,
1120
],
"parameters": {
"color": 7,
"width": 2162,
"height": 752,
"content": "### Audience Review & Publishing\nTailors knowledge articles for the appropriate audience, routes them for approval, and publishes approved content while maintaining visibility into review outcomes and article performance."
},
"typeVersion": 1
},
{
"id": "a6b7a808-c28f-4748-9bc3-5665f89665a6",
"name": "Groq Model \u2013 Issue Analysis",
"type": "@n8n/n8n-nodes-langchain.lmChatGroq",
"notes": "FIX 3: was meta-llama/llama-prompt-guard-2-86m (a security/classification model, not a reasoning model). Switched to llama-3.3-70b-versatile so it can actually do the root-cause analysis.",
"position": [
128,
1808
],
"parameters": {
"model": "llama-3.3-70b-versatile",
"options": {}
},
"typeVersion": 1
},
{
"id": "f0278b8d-55f6-4aab-93b1-43dc168a2006",
"name": "Check Issue Analysis Output",
"type": "n8n-nodes-base.if",
"notes": "FIX 12 (new node): guards against an empty/failed LLM response before it gets parsed downstream. True -> Structure AI Analysis Results, False -> failure alert.",
"position": [
400,
1584
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "b1e2c3d4-2222-4a2b-8c3d-222222222220",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ !!$json.output && $json.output.trim().length > 0 }}",
"rightValue": true
}
]
}
},
"typeVersion": 2.2
},
{
"id": "42d5c280-bd6e-400b-b425-70114468c130",
"name": "Generate KB Article",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
1072,
1488
],
"parameters": {
"text": "=Create a professional knowledge base article.\n\nArticle Title:\n{{$json.title}}\n\nRoot Cause:\n{{$json.root_cause}}\n\nCommon Problem:\n{{$json.problem}}\n\nBest Resolution:\n{{$json.resolution}}\n\nInclude:\n\n1. Overview\n2. Problem Description\n3. Root Cause\n4. Step-by-Step Resolution\n5. FAQ\n6. Escalation Process\n7. Related Procurement Policies\n\nFormat the entire article in Markdown.",
"options": {},
"promptType": "define"
},
"typeVersion": 3.1
},
{
"id": "b6a84310-0c70-439f-af53-04016ae39808",
"name": "Groq Model \u2013 Article Writer",
"type": "@n8n/n8n-nodes-langchain.lmChatGroq",
"position": [
1152,
1712
],
"parameters": {
"model": "llama-3.3-70b-versatile",
"options": {}
},
"typeVersion": 1
},
{
"id": "9342bbda-9927-495b-9d11-a9c2d523fcf8",
"name": "Set Article",
"type": "n8n-nodes-base.set",
"position": [
1648,
1312
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "6353781f-eb85-4b81-af36-4d298e0c92c6",
"name": "title",
"type": "string",
"value": "={{$('Structure AI Analysis Results').item.json.title}}"
},
{
"id": "c517e505-f0fd-417b-9bc3-35902c5944e2",
"name": "article",
"type": "string",
"value": "={{$json.output}}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "a610755e-ef9b-4f2e-8ec7-1c24e645eabf",
"name": "Audience Detection",
"type": "@n8n/n8n-nodes-langchain.agent",
"notes": "FIX 6: tightened to a closed-set instruction with explicit 'no explanation/punctuation' so the output is deterministic enough to branch on reliably.",
"position": [
2160,
1312
],
"parameters": {
"text": "=Determine who should read this article.\n\nArticle:\n{{$json.article}}\n\nReturn ONLY one of the following values, with no explanation, punctuation, or extra text:\n\nEmployees\nSuppliers\nProcurement Specialists",
"options": {},
"promptType": "define"
},
"typeVersion": 3.1
},
{
"id": "2c98460d-3770-498c-9bb0-1504ce18f1f3",
"name": "Groq Model \u2013 Audience Detector",
"type": "@n8n/n8n-nodes-langchain.lmChatGroq",
"position": [
2240,
1536
],
"parameters": {
"model": "llama-3.3-70b-versatile",
"options": {}
},
"typeVersion": 1
},
{
"id": "e28e89d0-20ca-41a4-94ce-22a603dd8535",
"name": "Set Audience",
"type": "n8n-nodes-base.set",
"position": [
2512,
1312
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "7ea9b364-a04c-425a-9250-db95fe28e94c",
"name": "audience",
"type": "string",
"value": "={{$json.output.trim()}}"
},
{
"id": "cd4cee91-d651-4164-b491-14b95ab499bd",
"name": "title",
"type": "string",
"value": "={{$('Set Article').item.json.title}}"
},
{
"id": "4bd80734-23d9-48af-b28b-a5043b5775da",
"name": "article",
"type": "string",
"value": "={{$('Set Article').item.json.article}}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "f4431b49-b0fb-4bbe-bb87-e94732c76fe9",
"name": "Adapt Tone for Audience",
"type": "@n8n/n8n-nodes-langchain.agent",
"notes": "FIX 7: clearer per-audience rules, explicit instruction to preserve facts and return Markdown.\nBONUS FIX: the old 'Audience Is Supplier' IF node routed BOTH its true and false outputs to this exact same node, so it was never actually branching anything (this prompt already handles all 3 audiences on its own). Removed that node and wired Set Audience straight here.",
"position": [
2736,
1312
],
"parameters": {
"text": "=Rewrite this procurement article for the target audience.\n\nAudience:\n{{$json.audience}}\n\nRequirements:\n\nEmployees:\n- Internal processes and terminology are allowed\n- Conversational, internal tone\n\nSuppliers:\n- External-facing tone\n- Simple language, no internal abbreviations\n- Avoid internal-only terminology\n\nProcurement Specialists:\n- Include compliance language\n- Reference audit and procurement best practices\n\nPreserve all factual information from the original article. Return the result in Markdown.\n\nArticle:\n{{$json.article}}",
"options": {},
"promptType": "define"
},
"typeVersion": 3.1
},
{
"id": "2514fed2-cb5d-47d8-b205-6cc5fd13c24d",
"name": "Groq Model \u2013 Tone Rewriter",
"type": "@n8n/n8n-nodes-langchain.lmChatGroq",
"position": [
2816,
1536
],
"parameters": {
"model": "llama-3.3-70b-versatile",
"options": {}
},
"typeVersion": 1
},
{
"id": "70d83e3e-501c-450c-b043-d11f6db83afb",
"name": "Finalize Draft",
"type": "n8n-nodes-base.set",
"notes": "Now carries category/department forward from Add Article Metadata so the KB sheet log has real values instead of blanks.",
"position": [
3088,
1312
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "+1234567890-f402-4cb1-9be5-b5a6eac80619",
"name": "title",
"type": "string",
"value": "={{$('Set Audience').item.json.title}}"
},
{
"id": "a910d337-42b7-419a-ae9e-d5ffa10966aa",
"name": "audience",
"type": "string",
"value": "={{$('Set Audience').item.json.audience}}"
},
{
"id": "fe9c7e7b-5c11-48d0-b9d8-39f7af7c7a74",
"name": "article",
"type": "string",
"value": "={{$json.output}}"
},
{
"id": "5b3875db-d4b7-42be-83e2-10166df10d76",
"name": "status",
"type": "string",
"value": "Pending Approval"
},
{
"id": "d93e2ecd-7222-4561-a3d4-c9b269f569ca",
"name": "article_id",
"type": "string",
"value": "=KB-{{$now.format('yyyyLLddHHmmss')}}"
},
{
"id": "b1e2c3d4-7777-4a2b-8c3d-777777777701",
"name": "category",
"type": "string",
"value": "={{$('Add Article Metadata').item.json.category}}"
},
{
"id": "b1e2c3d4-7777-4a2b-8c3d-777777777702",
"name": "department",
"type": "string",
"value": "={{$('Add Article Metadata').item.json.department}}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "bf133965-1cef-4810-9431-f8a30f95b858",
"name": "Request Approval",
"type": "n8n-nodes-base.gmail",
"notes": "FIX 8: dropped the full article body from this email (risk of hitting size limits / unreadable approval emails). Reviewer now sees just title/audience/category/ID and approves from the execution log.",
"position": [
3312,
1312
],
"parameters": {
"message": "=A new knowledge base article is ready for review.<br><br>Title: {{$json.title}}<br>Audience: {{$json.audience}}<br>Category: {{$json.category}}<br>Article ID: {{$json.article_id}}<br><br>Please open the workflow execution log to review the full article content, then click Approve or Reject below.",
"options": {},
"subject": "=Approval needed: {{$json.title}}",
"operation": "sendAndWait"
},
"typeVersion": 2.1
},
{
"id": "85722596-290b-4acf-8c99-431ac6309639",
"name": "Approval Check",
"type": "n8n-nodes-base.if",
"position": [
3536,
1312
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "loose"
},
"combinator": "and",
"conditions": [
{
"id": "19d39cff-652e-4c28-abf7-f5dc2d2c240a",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{$json.data.approved}}",
"rightValue": true
}
]
}
},
"typeVersion": 2.2
},
{
"id": "fcdb6755-154c-488d-a28d-0b254f5a6af5",
"name": "Notify: Article Published",
"type": "n8n-nodes-base.gmail",
"notes": "FIX 8 + FIX 9: this is now just a short notification, not the KB store itself. The real article content lives in the Google Sheet below (Store Article & Log Metrics). Swap this whole branch for a Notion/Confluence/Google Docs node later if you want a dedicated KB app instead of Sheets.",
"position": [
3760,
1264
],
"parameters": {
"message": "=This knowledge base article has been approved and published.<br><br>Title: {{$('Finalize Draft').item.json.title}}<br>Audience: {{$('Finalize Draft').item.json.audience}}<br>Article ID: {{$('Finalize Draft').item.json.article_id}}<br><br>The full article content has been stored in the Knowledge Base sheet.",
"options": {},
"subject": "=Published: {{$('Finalize Draft').item.json.title}}"
},
"typeVersion": 2.1
},
{
"id": "a2a51d1a-cb72-436d-b0a1-b946ebfcdc93",
"name": "Needs Revision (Loop Back)",
"type": "n8n-nodes-base.noOp",
"position": [
3760,
1600
],
"parameters": {},
"typeVersion": 1
},
{
"id": "d9f9ee93-0d7f-4917-a3e9-dff869d71b85",
"name": "Retrieve Resolved Procurement Tickets",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1104,
1504
],
"parameters": {
"url": "https://jsonplaceholder.typicode.com/posts",
"options": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "status",
"value": "resolved"
},
{
"name": "department",
"value": "procurement"
},
{
"name": "last_days",
"value": "7"
}
]
}
},
"typeVersion": 4.4
},
{
"id": "eb387210-2071-4301-a73b-ea42bede9533",
"name": "Daily KB Generation Schedule",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
-1328,
1600
],
"parameters": {
"rule": {
"interval": [
{
"triggerAtHour": 9
}
]
}
},
"typeVersion": 1.3
},
{
"id": "0acd1278-3dad-4d56-af47-f1ac8fa7a115",
"name": "Retrieve Procurement Chat Queries",
"type": "n8n-nodes-base.httpRequest",
"position": [
-1104,
1696
],
"parameters": {
"url": "https://jsonplaceholder.typicode.com/comments",
"options": {},
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "intent",
"value": "procurement"
},
{
"name": "days",
"value": "7"
}
]
}
},
"typeVersion": 4.4
},
{
"id": "04f4a3b9-8195-48e0-aab0-1c001b8c297a",
"name": "Combine Support Data Sources",
"type": "n8n-nodes-base.merge",
"position": [
-880,
1600
],
"parameters": {},
"typeVersion": 3.2
},
{
"id": "75325018-715c-4f96-b788-e5203fd1a0ec",
"name": "Normalize Ticket & Chat Data",
"type": "n8n-nodes-base.set",
"notes": "FIX 1: jsonplaceholder /posts returns title+body, /comments returns name+body+email. Mapping now falls back across both shapes instead of assuming a 'subject'/'resolution' field that never exists.",
"position": [
-656,
1600
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "91183d3b-cd4a-430b-8f00-64075bdba2ad",
"name": "source",
"type": "string",
"value": "={{$json.email ? \"chatbot\" : \"ticket\"}}"
},
{
"id": "dabbb936-c107-4e00-b8bf-704af5d0fc24",
"name": "title",
"type": "string",
"value": "={{$json.title || $json.name || \"Procurement Issue\"}}"
},
{
"id": "e05a6e59-57cf-4af1-be2c-de5b44a5a4ed",
"name": "description",
"type": "string",
"value": "={{$json.body || $json.description || \"No Description\"}}"
},
{
"id": "d7a4dd24-4e15-4164-b5fe-0f1f97296cce",
"name": "created_date",
"type": "string",
"value": "={{$now}}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "ef725a4b-195c-48fb-8d82-3fe9f2fe669b",
"name": "Cluster Similar Procurement Issues",
"type": "n8n-nodes-base.code",
"notes": "FIX 2: clusters on title+description text, with two extra categories (Contract Management, Purchasing) instead of just supplier/invoice/general.",
"position": [
-432,
1600
],
"parameters": {
"jsCode": "const clusters = {};\n\nfor (const item of items) {\n const text = (\n (item.json.title || \"\") + \" \" + (item.json.description || \"\")\n ).toLowerCase();\n\n let key = \"General Procurement\";\n\n if (text.includes(\"supplier\") || text.includes(\"vendor\")) {\n key = \"Supplier Management\";\n } else if (text.includes(\"invoice\") || text.includes(\"payment\")) {\n key = \"Invoice Processing\";\n } else if (text.includes(\"contract\")) {\n key = \"Contract Management\";\n } else if (text.includes(\"purchase\")) {\n key = \"Purchasing\";\n }\n\n if (!clusters[key]) {\n clusters[key] = [];\n }\n\n clusters[key].push(item.json);\n}\n\nreturn Object.entries(clusters).map(([topic, data]) => ({\n json: {\n topic,\n issues: data\n }\n}));"
},
"typeVersion": 2
},
{
"id": "73c661cc-c1d6-4931-b3eb-fcce019a2cb4",
"name": "Generate Cluster Summaries",
"type": "n8n-nodes-base.code",
"notes": "FIX 11 (new node): condenses each cluster's issues into a short plain-text summary before they hit the LLM, instead of stringifying the raw issues array. Avoids bloated prompts/token errors.",
"position": [
-208,
1600
],
"parameters": {
"jsCode": "return items.map(item => {\n const issues = (item.json.issues || []).slice(0, 5);\n\n const issue_summary = issues\n .map(i => `${i.title || i.name || \"Untitled\"} - ${i.description || i.body || \"No description\"}`)\n .join(\"\\n\");\n\n return {\n json: {\n topic: item.json.topic,\n issue_summary\n }\n };\n});"
},
"typeVersion": 2
},
{
"id": "2139a47b-70bb-4e57-b6c4-271a2e5a7b42",
"name": "Analyze Procurement Issue Patterns",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
48,
1584
],
"parameters": {
"text": "=Analyze the procurement issue cluster.\n\nTopic:\n{{$json.topic}}\n\nIssues:\n{{$json.issue_summary}}\n\nReturn ONLY JSON:\n\n{\n \"root_cause\":\"\",\n \"problem\":\"\",\n \"resolution\":\"\",\n \"title\":\"\"\n}",
"options": {},
"promptType": "define"
},
"typeVersion": 3.1
},
{
"id": "c7bed2c3-86e2-48b4-ade9-5b4c5e7976e0",
"name": "Structure AI Analysis Results",
"type": "n8n-nodes-base.code",
"notes": "FIX 4: falls back across output/text/response since different agent/model configs surface the reply under different keys.",
"position": [
624,
1488
],
"parameters": {
"jsCode": "return items.map(item => {\n try {\n const raw = String(\n item.json.output ||\n item.json.text ||\n item.json.response ||\n \"\"\n )\n .replace(/```json/g, \"\")\n .replace(/```/g, \"\")\n .trim();\n\n const parsed = JSON.parse(raw);\n\n return {\n json: {\n root_cause: parsed.root_cause || \"\",\n problem: parsed.problem || \"\",\n resolution: parsed.resolution || \"\",\n title: parsed.title || \"\"\n }\n };\n\n } catch (error) {\n return {\n json: {\n root_cause: \"Not determined\",\n problem: \"Not determined\",\n resolution: \"Not determined\",\n title: \"Untitled Procurement Issue\"\n }\n };\n }\n});"
},
"typeVersion": 2
},
{
"id": "d83b96c1-d940-4f5d-be6b-0a28c5667659",
"name": "AI Analysis Failed Alert",
"type": "n8n-nodes-base.gmail",
"position": [
624,
1680
],
"parameters": {
"message": "=The AI analysis step (Analyze Procurement Issue Patterns) returned an empty result and could not be processed.<br><br>Topic: {{$json.topic || 'Unknown'}}<br>Time: {{$now}}<br><br>Please check the Groq API credentials/model and re-run the workflow.",
"options": {},
"subject": "=KB Generation Failed: {{$json.topic || 'Procurement Issue'}}"
},
"typeVersion": 2.1
},
{
"id": "67400d26-5497-416a-86f6-8d395ca49230",
"name": "Add Article Metadata",
"type": "n8n-nodes-base.set",
"notes": "FIX 5 (new node): tags each draft with category/department/created_by/status before it goes into article generation, and these flow through to Finalize Draft + the KB sheet.",
"position": [
848,
1488
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "b1e2c3d4-4444-4a2b-8c3d-444444444401",
"name": "root_cause",
"type": "string",
"value": "={{$json.root_cause}}"
},
{
"id": "b1e2c3d4-4444-4a2b-8c3d-444444444402",
"name": "problem",
"type": "string",
"value": "={{$json.problem}}"
},
{
"id": "b1e2c3d4-4444-4a2b-8c3d-444444444403",
"name": "resolution",
"type": "string",
"value": "={{$json.resolution}}"
},
{
"id": "b1e2c3d4-4444-4a2b-8c3d-444444444404",
"name": "title",
"type": "string",
"value": "={{$json.title}}"
},
{
"id": "b1e2c3d4-4444-4a2b-8c3d-444444444405",
"name": "category",
"type": "string",
"value": "={{$('Cluster Similar Procurement Issues').item.json.topic}}"
},
{
"id": "b1e2c3d4-4444-4a2b-8c3d-444444444406",
"name": "created_by",
"type": "string",
"value": "AI KB Generator"
},
{
"id": "b1e2c3d4-4444-4a2b-8c3d-444444444407",
"name": "department",
"type": "string",
"value": "Procurement"
},
{
"id": "b1e2c3d4-4444-4a2b-8c3d-444444444408",
"name": "status",
"type": "string",
"value": "Draft"
},
{
"id": "b1e2c3d4-4444-4a2b-8c3d-444444444409",
"name": "created_date",
"type": "string",
"value": "={{$now}}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "72fd15a6-8acd-42cd-8246-4b30341159d0",
"name": "Check KB Article Output",
"type": "n8n-nodes-base.if",
"notes": "FIX 12 (new node): same empty-output guard as above, applied to the article-writing agent.",
"position": [
1424,
1408
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "b1e2c3d4-5555-4a2b-8c3d-555555555550",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
},
"leftValue": "={{ !!$json.output && $json.output.trim().length > 0 }}",
"rightValue": true
}
]
}
},
"typeVersion": 2.2
},
{
"id": "088c7cea-e8bb-4696-8a58-4b14e12f8664",
"name": "KB Article Failed Alert",
"type": "n8n-nodes-base.gmail",
"position": [
1648,
1504
],
"parameters": {
"message": "=The KB article generation step returned an empty result.<br><br>Title: {{$('Structure AI Analysis Results').item.json.title}}<br>Time: {{$now}}<br><br>Please check the Groq API credentials/model and re-run the workflow.",
"options": {},
"subject": "=KB Generation Failed: {{$('Structure AI Analysis Results').item.json.title}}"
},
"typeVersion": 2.1
},
{
"id": "63a9a4ea-5a9c-433e-b89a-2b720b4b9178",
"name": "Store Article & Log Metrics",
"type": "n8n-nodes-base.googleSheets",
"notes": "FIX 10 + bug fix: added Content/Department/Status columns and fixed Title, which previously read from a field that never existed on Merge's output. Now reads everything from Finalize Draft, the actual source of truth at publish time.",
"position": [
3984,
1264
],
"parameters": {
"columns": {
"value": {
"Title": "={{ $('Finalize Draft').item.json.title }}",
"Views": "0",
"Status": "Published",
"Content": "={{ $('Finalize Draft').item.json.article }}",
"Audience": "={{ $('Finalize Draft').item.json.audience }}",
"Article ID": "={{ $('Finalize Draft').item.json.article_id }}",
"Department": "={{ $('Finalize Draft').item.json.department }}",
"Publish Date": "={{ $now.format('yyyy-LL-dd HH:mm:ss') }}",
"Helpful Votes": "0"
},
"schema": [
{
"id": "Article ID",
"type": "string",
"display": true,
"required": false,
"displayName": "Article ID",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Title",
"type": "string",
"display": true,
"required": false,
"displayName": "Title",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Audience",
"type": "string",
"display": true,
"required": false,
"displayName": "Audience",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Publish Date",
"type": "string",
"display": true,
"required": false,
"displayName": "Publish Date",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Views",
"type": "string",
"display": true,
"required": false,
"displayName": "Views",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Helpful Votes",
"type": "string",
"display": true,
"required": false,
"displayName": "Helpful Votes",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Content",
"type": "string",
"display": true,
"required": false,
"displayName": "Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Department",
"type": "string",
"display": true,
"required": false,
"displayName": "Department",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Status",
"type": "string",
"display": true,
"required": false,
"displayName": "Status",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/11AxR-JRROAQDMFEZlnkVbCJikLhE15gi0L--17tXdTU/edit#gid=0",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "11AxR-JRROAQDMFEZlnkVbCJikLhE15gi0L--17tXdTU",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/11AxR-JRROAQDMFEZlnkVbCJikLhE15gi0L--17tXdTU/edit?usp=drivesdk",
"cachedResultName": "knowledge_base"
}
},
"typeVersion": 4.5
}
],
"active": false,
"settings": {
"binaryMode": "separate",
"executionOrder": "v1"
},
"versionId": "72b0fab3-aede-4049-a0f3-83d9871a71dd",
"connections": {
"Set Article": {
"main": [
[
{
"node": "Audience Detection",
"type": "main",
"index": 0
}
]
]
},
"Set Audience": {
"main": [
[
{
"node": "Adapt Tone for Audience",
"type": "main",
"index": 0
}
]
]
},
"Approval Check": {
"main": [
[
{
"node": "Notify: Article Published",
"type": "main",
"index": 0
}
],
[
{
"node": "Needs Revision (Loop Back)",
"type": "main",
"index": 0
}
]
]
},
"Finalize Draft": {
"main": [
[
{
"node": "Request Approval",
"type": "main",
"index": 0
}
]
]
},
"Request Approval": {
"main": [
[
{
"node": "Approval Check",
"type": "main",
"index": 0
}
]
]
},
"Audience Detection": {
"main": [
[
{
"node": "Set Audience",
"type": "main",
"index": 0
}
]
]
},
"Generate KB Article": {
"main": [
[
{
"node": "Check KB Article Output",
"type": "main",
"index": 0
}
]
]
},
"Add Article Metadata": {
"main": [
[
{
"node": "Generate KB Article",
"type": "main",
"index": 0
}
]
]
},
"Adapt Tone for Audience": {
"main": [
[
{
"node": "Finalize Draft",
"type": "main",
"index": 0
}
]
]
},
"Check KB Article Output": {
"main": [
[
{
"node": "Set Article",
"type": "main",
"index": 0
}
],
[
{
"node": "KB Article Failed Alert",
"type": "main",
"index": 0
}
]
]
},
"Notify: Article Published": {
"main": [
[
{
"node": "Store Article & Log Metrics",
"type": "main",
"index": 0
}
]
]
},
"Generate Cluster Summaries": {
"main": [
[
{
"node": "Analyze Procurement Issue Patterns",
"type": "main",
"index": 0
}
]
]
},
"Needs Revision (Loop Back)": {
"main": [
[
{
"node": "Generate KB Article",
"type": "main",
"index": 0
}
]
]
},
"Check Issue Analysis Output": {
"main": [
[
{
"node": "Structure AI Analysis Results",
"type": "main",
"index": 0
}
],
[
{
"node": "AI Analysis Failed Alert",
"type": "main",
"index": 0
}
]
]
},
"Combine Support Data Sources": {
"main": [
[
{
"node": "Normalize Ticket & Chat Data",
"type": "main",
"index": 0
}
]
]
},
"Daily KB Generation Schedule": {
"main": [
[
{
"node": "Retrieve Resolved Procurement Tickets",
"type": "main",
"index": 0
},
{
"node": "Retrieve Procurement Chat Queries",
"type": "main",
"index": 0
}
]
]
},
"Groq Model \u2013 Tone Rewriter": {
"ai_languageModel": [
[
{
"node": "Adapt Tone for Audience",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Normalize Ticket & Chat Data": {
"main": [
[
{
"node": "Cluster Similar Procurement Issues",
"type": "main",
"index": 0
}
]
]
},
"Groq Model \u2013 Article Writer": {
"ai_languageModel": [
[
{
"node": "Generate KB Article",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Groq Model \u2013 Issue Analysis": {
"ai_languageModel": [
[
{
"node": "Analyze Procurement Issue Patterns",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structure AI Analysis Results": {
"main": [
[
{
"node": "Add Article Metadata",
"type": "main",
"index": 0
}
]
]
},
"Groq Model \u2013 Audience Detector": {
"ai_languageModel": [
[
{
"node": "Audience Detection",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Retrieve Procurement Chat Queries": {
"main": [
[
{
"node": "Combine Support Data Sources",
"type": "main",
"index": 1
}
]
]
},
"Analyze Procurement Issue Patterns": {
"main": [
[
{
"node": "Check Issue Analysis Output",
"type": "main",
"index": 0
}
]
]
},
"Cluster Similar Procurement Issues": {
"main": [
[
{
"node": "Generate Cluster Summaries",
"type": "main",
"index": 0
}
]
]
},
"Retrieve Resolved Procurement Tickets": {
"main": [
[
{
"node": "Combine Support Data Sources",
"type": "main",
"index": 0
}
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This scheduled workflow pulls recent resolved procurement tickets and chat queries, clusters similar issues, and uses Groq LLMs to analyze patterns and draft Markdown knowledge base articles, then emails an approval request via Gmail and logs approved articles to Google Sheets.…
Source: https://n8n.io/workflows/17330/ — 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.
This workflow automates invoicing and payment follow-ups using Google Sheets, PDFShift, Groq (LLM), Gmail, and Telegram, sending initial invoices with PDF attachments, scheduling overdue reminders at
This workflow automatically monitors competitor product prices stored in Google Sheets. It scrapes product pages, extracts pricing and offer data using AI, and compares it with historical values. Base
Supplier Capacity Risk Alert Workflow. Uses httpRequest, lmChatGroq, agent, gmail. Scheduled trigger; 28 nodes.
This workflow automatically generates 2–3 high-quality Indian stock investment ideas daily by combining trending stock data + latest market news, processing it with AI (Groq/OpenAI), avoiding duplicat
This scheduled workflow reads leads from Google Sheets, researches each company with Tavily Search, uses Groq (Llama 3.3 70B) to generate a short personalized cold email, and saves the result as a Gma