Back to Catalog

Generate knowledge base articles with GPT & Perplexity AI for Contentful CMS

VarritechVarritech
5875 views
2/3/2026
Official Page

Workflow: Auto Knowledge Base Article Generator

โšก About the Creators

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 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:

  1. Chat Trigger โ†’ Receives user request
  2. AI Drafting Loop โ†’ Generates & refines JSON article via AI agents
  3. Perplexity Research Call โ†’ Deep-dive content generation
  4. Editorial Loop โ†’ Up to 3 AI-driven revisions
  5. Contentful Publish โ†’ Pushes final JSON into CMS

๐Ÿ“ฆ Node-by-Node Breakdown

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:

{
  "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

  1. Initialize Counter to 0
  2. AI Editor Agent
    • Reads draft JSON
    • Returns either:
      • action: "rewrite" + improvements: [...]
      • or action: "submit"
  3. Merge Improvements (if rewriting)
    • Applies suggested updates to JSON fields
  4. 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.

n8n Workflow: AI-Powered Knowledge Base Article Generation

This n8n workflow leverages AI to generate knowledge base articles based on user input, potentially for a Contentful CMS (though the Contentful node is not present in the provided JSON, it's inferred from the directory name). It uses an AI agent with an OpenAI Chat Model and a custom n8n workflow tool to gather information and craft article content.

What it does

This workflow automates the following steps:

  1. Receives Chat Messages: It starts by listening for incoming chat messages, acting as the trigger for the article generation process.
  2. Initializes AI Agent: An AI Agent is initialized, configured to use an OpenAI Chat Model for natural language understanding and generation.
  3. Utilizes a Custom Tool: The AI Agent is equipped with a "Call n8n Workflow Tool". This suggests the AI can execute a sub-workflow to perform specific tasks, likely for data retrieval or external API calls (e.g., to Perplexity AI as hinted by the directory name, or to search for information).
  4. Processes AI Output: After the AI agent completes its task, the workflow processes the output.
  5. Conditional Logic: An 'If' node introduces conditional logic, branching the workflow based on certain criteria from the AI's output.
  6. Data Transformation: 'Function' and 'Edit Fields (Set)' nodes are used to manipulate and transform the data, preparing it for subsequent steps.
  7. HTTP Request: An 'HTTP Request' node is present, indicating that the workflow can interact with external web services or APIs. This could be used to fetch additional data, or to post the generated article to a CMS like Contentful.
  8. Merges Data: A 'Merge' node is used to combine data streams, ensuring all necessary information is consolidated before final actions.
  9. No Operation: A 'No Operation, do nothing' node is included, which might serve as a placeholder or a point where the workflow can be extended without immediately performing an action.
  10. Code Execution: A 'Code' node allows for custom JavaScript execution, providing flexibility for complex data manipulation or logic not covered by standard nodes.

Prerequisites/Requirements

To use this workflow, you will need:

  • n8n Instance: A running n8n instance.
  • OpenAI API Key: For the OpenAI Chat Model used by the AI Agent.
  • Credentials for the "Call n8n Workflow Tool": If the sub-workflow called by this tool requires specific credentials (e.g., for Perplexity AI, Contentful, or other services), these will need to be configured within that sub-workflow.
  • External Services (Optional, but likely): Depending on the "Call n8n Workflow Tool" and HTTP Request node's configuration, access to services like Perplexity AI (for content generation/research) and Contentful (for CMS integration) might be required.

Setup/Usage

  1. Import the workflow: Download the JSON file and import it into your n8n instance.
  2. Configure Credentials:
    • Set up your OpenAI API Key credentials within n8n and select them in the "OpenAI Chat Model" node.
    • Ensure any credentials required by the "Call n8n Workflow Tool" (which executes a sub-workflow) are correctly configured within that sub-workflow.
  3. Customize the "Call n8n Workflow Tool": The "Call n8n Workflow Tool" node needs to be configured to point to the specific sub-workflow responsible for fetching or generating content (e.g., interacting with Perplexity AI).
  4. Configure HTTP Request: Adjust the "HTTP Request" node to interact with your target CMS (e.g., Contentful) for posting the generated articles, including the correct endpoint, authentication, and payload structure.
  5. Activate the Workflow: Once configured, activate the workflow. It will then listen for incoming chat messages to trigger the article generation process.
  6. Test: Send a chat message to the configured trigger to test the end-to-end article generation and posting process.

Related Templates

Automate Dutch Public Procurement Data Collection with TenderNed

TenderNed Public Procurement What This Workflow Does This workflow automates the collection of public procurement data from TenderNed (the official Dutch tender platform). It: Fetches the latest tender publications from the TenderNed API Retrieves detailed information in both XML and JSON formats for each tender Parses and extracts key information like organization names, titles, descriptions, and reference numbers Filters results based on your custom criteria Stores the data in a database for easy querying and analysis Setup Instructions This template comes with sticky notes providing step-by-step instructions in Dutch and various query options you can customize. Prerequisites TenderNed API Access - Register at TenderNed for API credentials Configuration Steps Set up TenderNed credentials: Add HTTP Basic Auth credentials with your TenderNed API username and password Apply these credentials to the three HTTP Request nodes: "Tenderned Publicaties" "Haal XML Details" "Haal JSON Details" Customize filters: Modify the "Filter op ..." node to match your specific requirements Examples: specific organizations, contract values, regions, etc. How It Works Step 1: Trigger The workflow can be triggered either manually for testing or automatically on a daily schedule. Step 2: Fetch Publications Makes an API call to TenderNed to retrieve a list of recent publications (up to 100 per request). Step 3: Process & Split Extracts the tender array from the response and splits it into individual items for processing. Step 4: Fetch Details For each tender, the workflow makes two parallel API calls: XML endpoint - Retrieves the complete tender documentation in XML format JSON endpoint - Fetches metadata including reference numbers and keywords Step 5: Parse & Merge Parses the XML data and merges it with the JSON metadata and batch information into a single data structure. Step 6: Extract Fields Maps the raw API data to clean, structured fields including: Publication ID and date Organization name Tender title and description Reference numbers (kenmerk, TED number) Step 7: Filter Applies your custom filter criteria to focus on relevant tenders only. Step 8: Store Inserts the processed data into your database for storage and future analysis. Customization Tips Modify API Parameters In the "Tenderned Publicaties" node, you can adjust: offset: Starting position for pagination size: Number of results per request (max 100) Add query parameters for date ranges, status filters, etc. Add More Fields Extend the "Splits Alle Velden" node to extract additional fields from the XML/JSON data, such as: Contract value estimates Deadline dates CPV codes (procurement classification) Contact information Integrate Notifications Add a Slack, Email, or Discord node after the filter to get notified about new matching tenders. Incremental Updates Modify the workflow to only fetch new tenders by: Storing the last execution timestamp Adding date filters to the API query Only processing publications newer than the last run Troubleshooting No data returned? Verify your TenderNed API credentials are correct Check that you have setup youre filter proper Need help setting this up or interested in a complete tender analysis solution? Get in touch ๐Ÿ”— LinkedIn โ€“ Wessel Bulte

Wessel BulteBy Wessel Bulte
247

๐ŸŽ“ How to transform unstructured email data into structured format with AI agent

This workflow automates the process of extracting structured, usable information from unstructured email messages across multiple platforms. It connects directly to Gmail, Outlook, and IMAP accounts, retrieves incoming emails, and sends their content to an AI-powered parsing agent built on OpenAI GPT models. The AI agent analyzes each email, identifies relevant details, and returns a clean JSON structure containing key fields: From โ€“ senderโ€™s email address To โ€“ recipientโ€™s email address Subject โ€“ email subject line Summary โ€“ short AI-generated summary of the email body The extracted information is then automatically inserted into an n8n Data Table, creating a structured database of email metadata and summaries ready for indexing, reporting, or integration with other tools. --- Key Benefits โœ… Full Automation: Eliminates manual reading and data entry from incoming emails. โœ… Multi-Source Integration: Handles data from different email providers seamlessly. โœ… AI-Driven Accuracy: Uses advanced language models to interpret complex or unformatted content. โœ… Structured Storage: Creates a standardized, query-ready dataset from previously unstructured text. โœ… Time Efficiency: Processes emails in real time, improving productivity and response speed. *โœ… Scalability: Easily extendable to handle additional sources or extract more data fields. --- How it works This workflow automates the transformation of unstructured email data into a structured, queryable format. It operates through a series of connected steps: Email Triggering: The workflow is initiated by one of three different email triggers (Gmail, Microsoft Outlook, or a generic IMAP account), which constantly monitor for new incoming emails. AI-Powered Parsing & Structuring: When a new email is detected, its raw, unstructured content is passed to a central "Parsing Agent." This agent uses a specified OpenAI language model to intelligently analyze the email text. Data Extraction & Standardization: Following a predefined system prompt, the AI agent extracts key information from the email, such as the sender, recipient, subject, and a generated summary. It then forces the output into a strict JSON structure using a "Structured Output Parser" node, ensuring data consistency. Data Storage: Finally, the clean, structured data (the from, to, subject, and summarize fields) is inserted as a new row into a specified n8n Data Table, creating a searchable and reportable database of email information. --- Set up steps To implement this workflow, follow these configuration steps: Prepare the Data Table: Create a new Data Table within n8n. Define the columns with the following names and string type: From, To, Subject, and Summary. Configure Email Credentials: Set up the credential connections for the email services you wish to use (Gmail OAuth2, Microsoft Outlook OAuth2, and/or IMAP). Ensure the accounts have the necessary permissions to read emails. Configure AI Model Credentials: Set up the OpenAI API credential with a valid API key. The workflow is configured to use the model, but this can be changed in the respective nodes if needed. Connect the Nodes: The workflow canvas is already correctly wired. Visually confirm that the email triggers are connected to the "Parsing Agent," which is connected to the "Insert row" (Data Table) node. Also, ensure the "OpenAI Chat Model" and "Structured Output Parser" are connected to the "Parsing Agent" as its AI model and output parser, respectively. Activate the Workflow: Save the workflow and toggle the "Active" switch to ON. The triggers will begin polling for new emails according to their schedule (e.g., every minute), and the automation will start processing incoming messages. --- Need help customizing? Contact me for consulting and support or add me on Linkedin.

DavideBy Davide
1616

Synchronizing WooCommerce inventory and creating products with Google Gemini AI and BrowserAct

Synchronize WooCommerce Inventory & Create Products with Gemini AI & BrowserAct This sophisticated n8n template automates WooCommerce inventory management by scraping supplier data, updating existing products, and intelligently creating new ones with AI-formatted descriptions. This workflow is essential for e-commerce operators, dropshippers, and inventory managers who need to ensure their product pricing and stock levels are synchronized with multiple third-party suppliers, minimizing overselling and maximizing profit. --- Self-Hosted Only This Workflow uses a community contribution and is designed and tested for self-hosted n8n instances only. --- How it works The workflow is typically run by a Schedule Trigger (though a Manual Trigger is also shown) to check stock automatically. It reads a list of suppliers and their inventory page URLs from a central Google Sheet. The workflow loops through each supplier: A BrowserAct node scrapes the current stock and price data from the supplier's inventory page. A Code node parses this bulk data into individual product items. It then loops through each individual product found. The workflow checks WooCommerce to see if the product already exists based on its name. If the product exists: It proceeds to update the existing product's price and stock quantity. If the product DOES NOT exist: An If node checks if the missing product's category matches a predefined type (optional filtering). If it passes the filter, a second BrowserAct workflow scrapes detailed product attributes from a dedicated product page (e.g., DigiKey). An AI Agent (Gemini) transforms these attributes into a specific, styled HTML table for the product description. Finally, the product is created in WooCommerce with all scraped details and the AI-generated description. Error Handling: Multiple Slack nodes are configured to alert your team immediately if any scraping task fails or if the product update/creation process encounters an issue. Note: This workflow does not support image uploads for new products. To enable this functionality, you must modify both the n8n and BrowserAct workflows. --- Requirements BrowserAct API account for web scraping BrowserAct n8n Community Node -&gt; (n8n Nodes BrowserAct) BrowserAct templates named โ€œWooCommerce Inventory & Stock Synchronizationโ€ and โ€œWooCommerce Product Data Reconciliationโ€ Google Sheets credentials for the supplier list WooCommerce credentials for product management Google Gemini account for the AI Agent Slack credentials for error alerts --- Need Help? How to Find Your BrowseAct API Key & Workflow ID How to Connect n8n to Browseract How to Use & Customize BrowserAct Templates How to Use the BrowserAct N8N Community Node --- Workflow Guidance and Showcase STOP Overselling! Auto-Sync WooCommerce Inventory from ANY Supplier

Madame AI Team | KaiBy Madame AI Team | Kai
600