Generate knowledge base articles with GPT Perplexity AI for Co
Workflow: Auto Knowledge Base Article Generator ⚡ About the Creators This workflow was created by Varritech Technologies, an innovative agency that leverages...
🔌 Nodes & Integrations Used (5)
📖 Implementation & Setup Guide
Workflow: Auto Knowledge Base Article Generator
⚡ About the Creators This workflow was created by [Varritech Technologies](https://varritech.com), 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 applications, and digital transformation solutions. If you need assistance implementing this workflow or have questions about content management solutions, please reach out to our team.
🏗️ Architecture Overview This workflow automates the end-to-end creation of a structured knowledge-base article from a simple chat prompt:
- **Chat Trigger** → Receives user request
- **AI Drafting Loop** → Generates & refines JSON article via AI agents
- **Perplexity Research Call** → Deep-dive content generation
- **Editorial Loop** → Up to 3 AI-driven revisions
- **Contentful Publish** → Pushes final JSON into CMS
---
📦 Node-by-Node Breakdown
```mermaid flowchart LR A[Webhook: Chat Trigger] --> B[AI Writer Agent] B --> C[HTTP Request: Perplexity Content] C --> D[Function: Format Output & Citations] D --> E[Loop Start: Initialize Count] E --> F[AI Editor Agent] F --> G{action == "rewrite"?} G -- yes --> H[Function: Merge Improvements] H --> I[Increment Count] --> F G -- no --> J[Stop Loop] J --> K[HTTP Request: Publish to Contentful] ```
Webhook: Chat Trigger
**Type**: HTTP Webhook (POST /webhook/knowledge-article)
**Payload**:
``` { "chatInput": "What topics should I write about?" } ```
**Purpose**: Kicks off the workflow on that chat prompt.
AI Writer Agent
**Inputs**: chatInput or existing article JSON
**Outputs**:
``` { "title": "...", "slug": "...", "category.id": "...", "description": "...", "keywords": [...], "content": "...", "metaTitle": "...", "metaDescription": "...", "readingTime": 5, "difficulty": "intermediate" } ```
**Purpose**: Generates the article skeleton (metadata + initial content).
HTTP Request: Perplexity Content
**Method:** POST
**URL:** https://api.perplexity.ai/research
**Body:** ```json { "model": "sonar-deep-research", "query": "{{ $json.title }}", "length": 1000 } ```
**Purpose:** Retrieves a long-form, deeply researched draft for the article body.
Function: Format Output & Citations
**Logic:**
- Parse raw Perplexity response
- Extract source URIs
- Append them under a sources markdown list
Editorial Loop
- Initialize Counter to 0
- AI Editor Agent
- - Reads draft JSON
- - Returns either:
- - `action: "rewrite" + improvements: [...]`
- - or `action: "submit"`
- Merge Improvements (if rewriting)
- - Applies suggested updates to JSON fields
- Limit Check
- - Stops after 3 iterations or on "submit"
HTTP Request: Publish to Contentful
**Method:** PUT
**URL:** https://cdn.contentful.com/spaces/{space}/environments/master/entries/{entryId}
**Headers:** - Authorization: Bearer <token> - Content-Type: application/vnd.contentful.management.v1+json
**Body:** Maps JSON → Contentful entry fields
**Outcome:** Publishes the finalized article live.
🔍 Design Rationale & Best Practices
Separation of Concerns Writer vs. Editor agents isolate creative drafting from quality review.
Idempotent Loop Counter + action flags prevent infinite retries.
Extensibility Swap in different research APIs or CMS targets with minimal changes.
Structured JSON Ensures predictable input/output for each node.
⚡ How to import this workflow into n8n:
- Click the Direct Download JSON button above to save
Generate_knowledge_base_articles_with_GPT_Perplexity_AI_for_Co.json. - Log in to your n8n Cloud or self-hosted n8n instance.
- In your workflow canvas, click the menu in top-right and select Import from File (or paste the JSON directly).
- Configure your credentials (e.g. API keys, database URLs) in the corresponding node settings.
- Click Execute Workflow to test and switch to Active!
Related AI Agents Workflows
View All in AI Agents →5 ways to process images PDFs with Gemini AI in n8n
How it works Many users have asked in the support forum about different methods to analyze images and PDF documents with Google Gemini AI in n8n. This workfl...
7 AI Sales Assistant
Production-ready n8n automation template for 7 AI Sales Assistant built by AhiXLight. Seamlessly connects Airtop Tool, Slack, Airtop with 24 configured nodes.
AAVE portfolio professional AI agent Telegram Email GPT 4o
A next-generation AI-powered DeFi health monitor that tracks wallet positions across Aave V3 using GPT-4o and LangChain. It delivers human-readable reports v...
Access control for AI agents RBAC using Airtable and Telegram
Purpose This workflow allows granular control over the access to tools connected to AI Agents (including Multi-Agent setups) using Role Based Access Control....