AI-Powered Q&A Chatbot for Confluence Documentation - n8n Workflow

Use this powerful n8n workflow to turn your Confluence pages into an AI-powered chatbot. Deploy intelligent Q&A powered by RAG, memory, and OpenAI integration.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Internal documentation specialists needing instant Q&A capabilities.

  • Teams using Confluence as a primary knowledge base.

  • Developers and automation experts looking for advanced RAG n8n templates.

  • Users who need to quickly implement a stateful AI agent using n8n and Langchain nodes.

Overview

Information silos make finding crucial documentation difficult. This n8n workflow solves this by transforming specific Confluence pages into a dedicated Retrieval-Augmented Generation (RAG) knowledge base. By integrating an interactive n8n trigger with the power of OpenAI, the system can instantly search, retrieve, process, and summarize complex documentation into conversational answers. This particular n8n workflow is designed to maintain conversation history using memory nodes and delivers the final output via Telegram, making it a highly accessible and actionable solution for immediate internal support.

How it Works

This automation initiates with the 'When chat message received' n8n trigger, which captures the user's question and session ID, essential for maintaining context throughout the n8n workflow.


  1. Initialize Variables: The flow first hits the 'Globals' n8n node, which defines specific Confluence page IDs that the chatbot will use as context (acting as configuration).

  2. Retrieve Metadata: It uses the 'Search By ID' HTTP Request n8n node, leveraging the Confluence API, to find the base data for the configured page ID.

  3. Fetch Content: After splitting the result, the 'Confluence Page Storage View' HTTP Request n8n node fetches the detailed content of the page, requesting the body in 'storage' format.

  4. Data Preparation: The crucial 'HTML to Markdown' n8n node sanitizes the raw HTML storage format from Confluence, converting it into clean Markdown. This clean data is the precise context used by the AI Agent.

  5. AI Processing: The AI Agent n8n node orchestrates the RAG process. It is configured with the gpt-4o-mini language model and the 'Window Buffer Memory' n8n node, ensuring the chatbot remembers previous parts of the conversation. The AI is strictly instructed to answer only based on the Confluence context provided.

  6. Final Output: The response generated by the AI is captured by the 'Chat Response' n8n node and finally sent to the user via the 'Send Telegram Message' n8n node, completing the interactive cycle of the n8n workflow.

Installation Guide

To deploy this specialized n8n workflow template, follow these steps:


  1. Import: Copy the entire JSON code and paste it directly into your n8n canvas using the 'New' -> 'Import from JSON' option.

  2. Credentials Setup:

Confluence API: Configure an HTTP Header Auth credential. This is crucial for accessing the Confluence API. As described in the sticky note, you must use Basic Auth, requiring a Base64-encoded string of your Atlassian email and API token.
OpenAI API: Configure your OpenAI API Key for the gpt-4o-mini n8n node.
* Telegram: Set up Telegram credentials. You must also configure the environment variable TELEGRAMCHATID or replace the expression in the Telegram n8n node parameter.

  1. Configuration: Edit the 'Globals' n8n node to replace the placeholder Confluence Page IDs with the IDs of the documents you want the chatbot to read.

  2. Activate: Set the n8n workflow to 'Active' to start listening for chat messages.

Node Details

When chat message received (n8n trigger): The entry point. It's a manual chat trigger used in n8n templates designed for interactive AI agents, providing the initial user input and session ID.
Globals (Set n8n node): Holds pre-configured variables, specifically several Confluence page IDs (e.g., pageidn8n). This determines which document the AI will be querying.
Search By ID (HTTP Request n8n node): Queries the Confluence search API using the predefined page ID to confirm the page existence and retrieve necessary metadata.
Confluence Page Storage View (HTTP Request n8n node): Fetches the page content. Key configuration is the query parameter body-format: storage, ensuring we get the full, raw HTML content suitable for parsing.
HTML to Markdown (Markdown n8n node): Essential pre-processing step. Converts the complex Confluence storage HTML into clean Markdown text, which significantly improves the quality of the context provided to the AI.
gpt-4o-mini (Language Model n8n node): The core intelligence, handling the heavy lifting of understanding the context and generating the answer.
Window Buffer Memory (Memory n8n node): Stores and retrieves previous turns in the conversation using the session ID, allowing the AI Agent to maintain conversational state within this complex n8n workflow.
AI Agent (Agent n8n node): The orchestrator. It receives the prepared context (from Markdown), the user question (from the n8n trigger), and the memory, applying system instructions to produce a grounded response.


  • Send Telegram Message (Telegram n8n node): The final action, delivering the AI-generated answer back to the user.

Related n8n Workflows

Free

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by
Joseph LePage
Joseph LePage

As an AI Automation consultant based in Canada, I partner with forward-thinking organizations to implement AI solutions that streamline operations and drive growth.

Featured*