Telegram AI Assistant

Telegram AI AssistantTelegram Bots

This workflow creates a Telegram chatbot that accepts both text and voice messages, transcribes audio using OpenAI, and generates contextual replies with a LangChain/OpenAI agent while maintaining a short-term conversation history. It is suitable as a ready-made template to run an AI assistant inside Telegram that responds to text and voice inputs.

What You Can Do:

  • Accept text and voice messages from Telegram users
  • Automatically transcribe voice messages to text using OpenAI’s audio transcription
  • Generate contextual, formatted replies using an OpenAI-based LangChain agent
  • Maintain a short conversation history (window buffer) for coherence
  • Deliver replies back to users in Telegram with HTML-compatible formatting

Quick Start:

  1. Configure the Telegram credentials (bot token) in n8n and set the Telegram trigger to use a webhook. The webhookId in the workflow is a placeholder and must be set up in your n8n instance.
  2. Add your OpenAI API key in the workflow credentials.
  3. Activate the workflow in n8n and send a text or voice message to the Telegram bot to test responses.
  4. Review the Window Buffer Memory node settings to adjust how much recent conversation context is retained.
Flownerd