Skip to main content

Detect KB gaps and auto-draft articles with GPT-4.1, Slack and Gmail

Workflow preview

Workflow preview
100%
Detect KB gaps and auto-draft articles with GPT-4.1, Slack and Gmail preview
Open on n8n.io

1. Workflow Overview

Who is this for? Support teams, knowledge managers, and ops builders who are drowning in outdated KB articles and repeat tickets . If your team keeps answering the same questions because your knowl...

Best for

  • Internal Wiki automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.scheduletrigger, n8n-nodes-base.httprequest, n8n-nodes-base.code, n8n-nodes-base.merge, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.if, n8n-nodes-base.errortrigger

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Carlo B..

Original n8n.io source

1.1 Workflow description

Title
Detect KB gaps and auto-draft articles with GPT-4.1, Slack and Gmail
Workflow name
Detect KB gaps and auto-draft articles with GPT-4.1, Slack and Gmail

Who is this for?

Support teams, knowledge managers, and ops builders who are drowning in outdated KB articles and repeat tickets. If your team keeps answering the same questions because your knowledge base has gaps nobody has time to find — this template finds them automatically and writes the first draft for you.

What does it do?

This is a complete multi-agent AI pipeline — 31 nodes across 7 pipeline stages that automate the entire KB maintenance lifecycle:

  • Gap analysis — An AI agent cross-references your recent support tickets against your existing KB articles and identifies what's missing, what's weak, and what's stale.
  • Automated article drafting — For every gap found, a second AI agent writes a complete KB article draft using your actual ticket data as context.
  • Quality review — A third AI agent scores each draft on accuracy, completeness, and clarity — so you know what's ready to publish and what needs work.
  • Health scoring — A fourth AI agent generates a comprehensive health report with a 0-100 score, letter grade, executive summary, and prioritised action items.
  • Dual notifications — Results are delivered via both Slack (rich blocks) and Gmail (polished HTML email) with color-coded health scores, gap tables, and action items.
  • Staleness detection — Flags existing articles that haven't been updated in configurable timeframes.
  • Scheduled automation — Runs daily on a cron schedule (or manually on demand).

How it works

The Configuration node defines your helpdesk API endpoints, notification settings, and thresholds. The pipeline fetches recent tickets and current KB articles via HTTP, normalises the data, then sends it to the Gap Analysis Agent (GPT-4.1).

If gaps are found, each gap is split into an individual item and routed through the Article Drafter AgentQuality Reviewer Agent pipeline. In parallel, a Staleness Check flags outdated articles.

All results merge into the Report Generator Agent, which produces a structured health report. The Format Outputs node transforms this into both Slack blocks and a polished HTML email, delivered simultaneously via webhook and Gmail.

If no gaps are found, the pipeline skips article drafting but still runs the staleness check and generates a health report.

How to use it

  1. Import the workflow JSON into n8n
  2. Open the Configuration node and set your helpdesk API URL, notification email, and Slack webhook
  3. Connect your OpenAI credentials to the 4 AI model nodes
  4. Connect your Gmail credential to the Send Email Report node
  5. Update the 2 HTTP Request fetch nodes with your helpdesk authentication
  6. Run manually to test, then activate the daily schedule

Required: OpenAI API key (GPT-4.1 and GPT-4.1-mini), Gmail account (for email reports) Optional: Slack incoming webhook (for Slack reports), any helpdesk with a REST API (Zendesk, Freshdesk, Intercom, etc.)


Tags

AI, AI Agent, Multi-Agent, LLM, OpenAI, GPT-4.1, Knowledge Base, Support, Helpdesk, Zendesk, Content, Automation, Gap Analysis, KB Management, Slack, Gmail, Report


Data Collection

> Ticket & KB Fetcher — Pulls recent support tickets and current knowledge base articles from your helpdesk API. Data is normalised into a consistent format for AI analysis. Update the HTTP Request nodes with your helpdesk URL and authentication.

AI Analysis Pipeline

> Multi-Agent Gap Analysis — 4 specialised AI agents work in sequence: (1) Gap Analysis identifies missing, weak, and stale content by cross-referencing tickets against KB articles. (2) Article Drafter writes complete KB article drafts for each gap. (3) Quality Reviewer scores each draft. (4) Report Generator produces a health score, executive summary, and prioritised actions.

Output & Notifications

> Dual Notification System — Results are formatted into both Slack blocks (with emoji health grades, key findings, and action items) and a polished HTML email (with color-coded score circle, gap tables with urgency badges, and action tables). Both are delivered simultaneously. Either channel can be disabled in the Configuration node.

Staleness Detection

> Article Freshness Check — Runs in parallel with the main pipeline. Flags any KB article not updated within the configurable threshold (default: 90 days). Results feed into the health report regardless of whether gaps were found.


Setup Note

> ⚠️ Credential Setup Required: After importing, you must configure: (1) OpenAI credentials on 4 AI model nodes (2x GPT-4.1, 2x GPT-4.1-mini), (2) Gmail OAuth credential on the Send Email Report node, (3) Your helpdesk API URL and auth on 2 HTTP Request nodes, and (4) Your Slack webhook URL and email address in the Configuration node. See the Setup Guide for a step-by-step checklist.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Daily Schedule

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 2 - Fetch Recent Support Tickets

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 3 - Fetch KB Articles

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 4 - Configuration

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - Normalize Ticket Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 6 - Normalize KB Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Merge Tickets + KB

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3

Block 8 - Prepare Analysis Payload

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 9 - Gap Analysis Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 10 - OpenAI GPT-4.1 (Gap Analysis)

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 11 - Parse Gap Analysis

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Gaps Found?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 13 - Split Into Individual Gaps

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 14 - Article Drafter Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 15 - OpenAI GPT-4.1 (Article Drafter)

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 16 - Parse Drafted Article

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 17 - Quality Reviewer Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 18 - OpenAI GPT-4.1-mini (Quality Review)

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 19 - Combine Article + Review

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 20 - Staleness Check

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 21 - Merge All Results

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3

Block 22 - Report Generator Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 23 - OpenAI GPT-4.1-mini (Report Generator)

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 24 - Format Outputs

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Showing the first 24 of 38 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Detect KB gaps and auto-draft articles with GPT-4.1, Slack and Gmail
Complexity advanced
Nodes 38
Categories Internal Wiki, AI RAG
Author Carlo B.
Published 09 Apr 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/14951/14951.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Detect KB gaps and auto-draft articles with GPT-4.1, Slack and Gmail do?

Who is this for? Support teams, knowledge managers, and ops builders who are drowning in outdated KB articles and repeat tickets . If your team keeps answering the same questions because your knowl...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Internal Wiki, AI RAG use case.