GPT-5 Conversational AI Chatbot for Telegram - n8n Workflow

Deploy a powerful, real-time GPT-5 conversational AI chatbot directly on Telegram using this flexible n8n workflow. Includes message logging and user experience enhancements.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • AI Developers: Looking for quick ways to deploy and test LLMs (like GPT-5) via a common messaging platform.

  • Automation Engineers: Seeking advanced n8n templates for handling real-time, user-driven data.

  • Community Managers: Needing an automated Q&A or support bot accessible through Telegram.

  • n8n Users: Interested in learning how to combine webhooks, AI processing, and Google Sheets logging within a single n8n node flow.

Overview

This powerful n8n workflow provides a comprehensive solution for deploying a real-time AI chatbot on Telegram. By integrating the Telegram webhook with a sophisticated AI model (GPT-5 via AIMLAPI), the automation ensures prompt, context-aware replies.

Unlike simple integrations, this n8n workflow enhances the user experience by immediately sending a 'typing...' indicator before the AI processes the request. Furthermore, the final step includes an optional but highly valuable Google Sheets logging component, making this one of the most useful n8n templates for analytics and auditing.

Every n8n node is configured for maximum efficiency, turning any standard Telegram account into a sophisticated, AI-powered conversational agent.

How it Works

This automation is initiated by the critical n8n trigger provided by the Telegram platform.


  1. Trigger: The n8n workflow starts when the ๐Ÿ“ฉ Receive Telegram Message n8n trigger detects a new message sent to the configured bot.

  2. UX Enhancement: Immediately, the ๐Ÿ’ฌ Simulate Typing in Telegram n8n node sends a 'typing...' action back to the user's chat, confirming receipt and providing a natural delay for processing.

  3. AI Processing: The message text is passed to the ๐Ÿง  Process with GPTโ€‘5 n8n node, which connects to the AIMLAPI using the openai/gpt-5-chat-latest model for high-quality response generation.

  4. Send Response: The ๐Ÿ“ค Send Response to Telegram n8n node takes the content generated by the AI and uses the original message's chatId to deliver the final text reply back to the user.

  5. Logging (Optional): Finally, the ๐Ÿ“ Log Successful Generation n8n node appends the interaction details (user ID, original query, and AI result) to a specified Google Sheet, completing the full cycle of the n8n workflow.

Installation Guide

To deploy this comprehensive n8n workflow, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON data and paste it into your n8n instance using the 'New' > 'Import from JSON' function.

  2. Set up Telegram Credentials: You must register a new bot with BotFather on Telegram. Once you receive your API token, create a new 'Telegram API' credential in n8n and link it to the ๐Ÿ“ฉ Receive Telegram Message n8n trigger and subsequent Telegram nodes.

  3. Set up AI Credentials: Create an 'AI/ML API' credential in n8n for AIMLAPI. Ensure the base URL is set to https://api.aimlapi.com/v1 and input your API key. This authenticates the ๐Ÿง  Process with GPTโ€‘5 n8n node.

  4. Configure Logging (Optional): If you wish to use the tracking features, connect your Google Sheets account to the ๐Ÿ“ Log Successful Generation n8n node and specify the exact Document ID and Sheet Name where the usage data should be appended.

  5. Activate the Workflow: Set the ๐Ÿ“ฉ Receive Telegram Message n8n trigger to 'Active' to start listening for incoming messages.

Node Details

๐Ÿ“ฉ Receive Telegram Message (n8n trigger):
Function: Serves as the primary n8n trigger, initiating the automation when a new message update is received from Telegram.
Key Configuration: Configured to watch for message updates.
๐Ÿ’ฌ Simulate Typing in Telegram (n8n node):
Function: Sends a sendChatAction (typing status) to the user's chat ID, improving the perceived speed and fluidity of the n8n workflow.
Key Configuration: Uses the original message's chat.id.
๐Ÿง  Process with GPTโ€‘5 (n8n node - AIMLAPI):
Function: The core processing unit. It sends the user's message as a prompt to the specified language model (openai/gpt-5-chat-latest).
Key Configuration: Model: openai/gpt-5-chat-latest. Prompt: Dynamic expression pulling text from the initial Telegram message.
๐Ÿ“ค Send Response to Telegram (n8n node):
Function: Posts the AI-generated content back to the user via Telegram.
Key Configuration: Chat Id: Uses the dynamic ID from the n8n trigger. Text: Uses the output content from the GPT-5 processing n8n node.
๐Ÿ“ Log Successful Generation (n8n node - Google Sheets):
Function: Optional but crucial n8n node for tracking usage. It appends a row with interaction metadata for later analysis.
* Key Configuration: Maps fields like user_id, date, query, and result using data pulled from previous nodes in the n8n workflow.

Related n8n Workflows

Free

Nodes: 5 Nodes
Updated: December 26 2025
View all

Featured*