Build an AI-Powered Confluence Chatbot with n8n Automation

Struggling to quickly find answers from Confluence pages? This n8n workflow creates an AI chatbot that fetches Confluence page content and answers queries accurately, saving hours of search time.
httpRequest
agent
manualChatTrigger
+7
Learn how to Build this Workflow with AI:
Workflow Identifier: 2223
NODES in Use: Sticky Note, HTTP Request, Set, Markdown, Manual Chat Trigger, Memory Buffer, LangChain AI Agent, OpenAI, Telegram, Split Out

Press CTRL+F5 if the workflow didn't load.

Visit through Desktop for Best experience

Opening Problem Statement

Meet Sarah, a project manager at a tech company who relies heavily on Confluence for documentation, project specs, and technical guides. Every day, Sarah spends countless minutes—sometimes even hours—searching through multiple Confluence pages to find precise information for her team. Sometimes she misinterprets outdated or bulky documents, leading to mistakes and delays. Sarah’s frustration peaks especially when urgent questions arise in meetings or over chat and there’s no easy way to get quick, accurate answers from Confluence without leaving her workflow.

This kind of scenario is more common than you think. Teams lose productivity, waste time manually scrolling through pages, and risk errors by missing updated content. Sarah needs a solution that combines Confluence knowledge access with conversational AI — a chatbot that understands her questions and can fetch the right Confluence page content instantly.

That’s exactly where this AI-powered Confluence Chatbot workflow in n8n comes in.

What This Automation Does

This workflow uses n8n’s powerful automation capabilities combined with the Confluence REST API and OpenAI’s GPT language model to create a smart chatbot for Confluence pages. Here’s what happens when you run this workflow:

  • Detects chat messages automatically with the “When chat message received” trigger node.
  • Maps Confluence page IDs and uses the “Search By ID” HTTP Request node to look up page metadata.
  • Fetches complete Confluence page content using another HTTP Request node, specifying the storage format for rich content retrieval.
  • Converts the Confluence page’s HTML content to Markdown for better readability and AI consumption with the Markdown node.
  • Processes user questions together with the page content context in an AI agent powered by GPT-4o-mini.
  • Maintains conversation context across messages with window buffer memory, making interactions more natural.
  • Sends the chatbot answer back via Telegram messaging node to the user’s chat platform.

By automating all these steps, this workflow can save Sarah and her team hours each week by instantly answering Confluence-related inquiries — no more digging through pages manually.

Prerequisites ⚙️

  • n8n account (cloud or self-hosted: if you want full control, check out self-hosting options with Hostinger)
  • Confluence Cloud account with API token (see Atlassian docs for generating tokens)
  • OpenAI account with API key access for GPT-4o-mini language model
  • Telegram bot and chat ID to send chatbot responses back
  • Basic familiarity with n8n interface for creating and editing workflows

Step-by-Step Guide

Step 1: Setup Confluence API Credentials in n8n 🔐

Navigate to Settings > API Credentials in n8n and create new HTTP Header Auth credentials for Confluence. Use your Atlassian account email and API token combined as a base64-encoded string in the header.

Example Authorization header:

Authorization: Basic eW91cl9lbWFpbEBkb21haW4uY29tOnlvdXJfYXBpX3Rva2Vu

This allows n8n to authenticate against your Confluence workspace API.

Common mistake: Forgetting to base64-encode the email and token string.

Step 2: Define Confluence Page IDs with “Globals” Node

In the workflow, the “Globals” Set node defines frequently used page IDs as strings. Update these IDs to your own Confluence page IDs to point the chatbot at the right pages to pull content from.

Navigate: Globals node → Assignments → page_id_n8n and replace with your Confluence page ID (integer as a string).

Confusing page IDs will cause the HTTP requests to fail or pull wrong content.

Step 3: Configure “Search By ID” HTTP Request Node

This node calls the Confluence REST API search endpoint using the page ID from the Globals node to get detailed metadata about the page.

Navigate: Search By ID node → Parameters → URL and ensure it follows the pattern:

https://[your-instance].atlassian.net/wiki/rest/api/search?limit=1&cql=id={{ $json.page_id_n8n }}

Ensure your credentials are attached under the Authentication section.

Step 4: Split the Search Results

The “Split Out” node extracts the results array from the Confluence Search API response, passing a single page metadata object forward.

Check: Split Out node → Field to Split Out, it should be set to results.

Step 5: Map Page Metadata Fields with “Page Schema” Node

This Set node extracts important page properties like title, excerpt, URL, and internal IDs required for the next API call to get full page content.

Verify the assignments to capture fields like content.id and content._links.webui.

Step 6: Fetch Full Page Content with “Confluence Page Storage View” HTTP Request

This node calls the Confluence Pages API to get the entire body of the specified page in the storage format, which retains the page content including macros and formatting.

Ensure the URL parameter is set like:
https://[your-instance].atlassian.net/wiki/api/v2/pages/{{ $json.id }} and the query parameter body-format=storage.

Step 7: Convert HTML Content to Markdown

The Confluence page content retrieved in HTML storage format is converted to Markdown using the “HTML to Markdown” node for better AI processing.

Step 8: Receive User Input and Maintain Chat Memory

The “When chat message received” node triggers on new user messages. The “Window Buffer Memory” node keeps conversation context by storing recent messages using a session key from the chat trigger node.

Step 9: Use GPT-4o-mini AI for Conversational Responses

The “gpt-4o-mini” OpenAI node takes the user question and the extracted page context (in Markdown) to generate an accurate response.

Step 10: AI Agent Combines Context and User Input

The “AI Agent” node uses LangChain to answer questions strictly based on the Confluence content context provided. It will respond with “I don’t know.” if information is unavailable, improving reliability.

Step 11: Format the Response with “Chat Response” Node

This Set node captures the AI Agent’s output and prepares it for sending to the user.

Step 12: Send the Chat Response to Telegram

Last, the “Send Telegram Message” node delivers the chatbot answer back to the user’s Telegram chat.

Fill in the chat ID environment variable and check the formatting options for clean display.

Customizations ✏️

  • Expand Supported Pages: Add more page IDs in the “Globals” node to broaden the chatbot’s knowledge base. Duplicate and modify the existing ID assignments.
  • Change Messaging Platform: Replace the “Send Telegram Message” node with Slack, email, or another messaging node to deliver answers where your team communicates.
  • Adjust AI Model Temperature: In the “gpt-4o-mini” node, tweak parameters like temperature or max tokens to control response creativity and length.
  • Switch Content Format: Modify the HTTP Request node query parameter to get page content in a different format like “view” or “editor” if your use case needs it.
  • Improve Memory Context: Adjust the “Window Buffer Memory” node session length or switch to a different memory strategy in LangChain for deeper conversations.

Troubleshooting 🔧

Problem: “Authentication failed” error on Confluence API calls.
Cause: Incorrect API token or missing base64 encoding.
Solution: Recheck API Token, regenerate if necessary, and ensure you base64 encode the concatenated email:token string exactly as per Atlassian instructions.

Problem: “Page not found” or empty response from API.
Cause: Incorrect or missing page ID in the “Globals” node.
Solution: Verify the page IDs correspond exactly to existing Confluence pages and update the IDs in the Set node.

Problem: The chatbot responds with “I don’t know.” to valid questions.
Cause: The AI context did not include the retrieved Confluence page content properly.
Solution: Check data mapping between HTTP Request to the HTML to Markdown node and ensure the AI prompt is correctly referencing the page content property.

Pre-Production Checklist ✅

  • Verify your Confluence API token works with a direct cURL or Postman test.
  • Send test queries in your chat platform to ensure the “When chat message received” trigger fires properly.
  • Check that the page IDs are accurate and the HTTP Request nodes return expected JSON content.
  • Test the AI node with sample user inputs to verify meaningful answers.
  • Ensure Telegram chat ID environment variable is set correctly for message delivery.
  • Backup your workflow and credential settings before production deployment.

Deployment Guide

Once you finish configuring all nodes and verifying individual steps, activate the workflow in n8n by toggling its status to active. Now the chatbot listens for user chat messages and responds immediately with accurate Confluence page info.

Monitor the execution logs under the n8n dashboard for errors or bottlenecks. Adjust API call rate limits or AI parameters as needed based on usage volume.

FAQs

Q: Can I use another language model besides GPT-4o-mini?
A: Yes, n8n supports other OpenAI models like GPT-3.5 or GPT-4. Just replace the AI node credentials and model configuration accordingly.

Q: Does this workflow consume many API credits?
A: It uses Confluence API calls and OpenAI credits. If usage is heavy, consider caching responses or limiting query frequency.

Q: Is my Confluence data secure?
A: Yes, your data passes through n8n with secure authentication. Keep your API tokens confidential and use encrypted n8n environments.

Q: Can this handle hundreds of questions?
A: Yes, but you may need to scale your n8n environment and handle API rate limits.

Conclusion

By building this custom AI-powered Confluence chatbot in n8n, you’ve equipped your team with a powerful tool to quickly access Confluence page content using natural language queries. This saves time previously spent hunting for info and reduces errors from misinterpreted documentation.

You now have a smart assistant powered by GPT-4o-mini and Confluence’s rich API data. Next steps could be adding support for more Confluence spaces, integrating other chat platforms, or enhancing memory with advanced LangChain techniques.

Dive in, customize your bot, and make Confluence knowledge easily accessible—right within your conversation flow.

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation in n8n (Beginner Guide)

A complete beginner guide to building an AI-powered SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free