Latenode

Automate Telegram support with GPT-4 and Supabase document retrieval

This automation allows you to create a Telegram bot that uses GPT-4 for multi-modal processing and Supabase RAG to provide automated support.

The bot can handle text, audio, image, and document inputs from users, extract the relevant information, and generate context-aware responses by querying a Supabase vector database for similar content and injecting it into the OpenAI language model prompt. This enables a full Retrieval-Augmented Generation (RAG) experience, where the bot's responses are grounded in the actual document content. The automation integrates with Telegram, OpenAI, Supabase, and supports a variety of document file types.

Updated Apr 2, 2026Est. run: 21sEst. cost: $0.0013
How Latenode estimates time and cost

Latenode bills workflow runs in credits: 1 credit = 30 seconds of processing. Minimum charge per run depends on your plan. Plug-and-Play (PnP) AI nodes are billed separately—each PnP token is $1 USD, charged pay-as-you-go at vendor cost plus a small processing fee, with no API keys required.

Full pricing — how credits work →
Messaging & bots

Workflow preview

What this template does

  • Integrates a Telegram bot with GPT-4 for multi-modal processing and Supabase RAG.
  • Extracts relevant information from text, audio, images, and documents submitted by users.
  • Generates context-aware responses by querying a Supabase vector database for similar content.
  • Injects the retrieved information into the OpenAI language model prompt for a full Retrieval-Augmented Generation experience.
  • Supports a variety of document file types and stores the processed data in a Supabase database.

How it works

1
Trigger

Capture user messages from Telegram

The automation starts by listening for incoming messages from users on the Telegram platform. This includes text, audio, image, and document inputs that the users send to the bot.

2
Action

Interpret user inputs with GPT-4

The user-submitted content is then passed to the OpenAI GPT-4 model, which analyzes the inputs and extracts the relevant information and intent.

3
Action

Retrieve relevant context from Supabase

The automation queries the Supabase vector store to find the most relevant documents and content that can provide context and information to address the user's request.

4
Logic

Combine retrieved context with user input

Custom logic is applied to combine the user's input with the relevant context retrieved from the Supabase vector store. This enables the GPT-4 model to generate a comprehensive, context-aware response to the user's request.

5
Action

Send response back to the user on Telegram

The generated response is then sent back to the user on the Telegram platform, providing the user with the requested information and support.

Setup guide

1

Add Telegram Bot Credential

Add your Telegram Bot API token as a credential in the Latenode Credentials panel.

2

Configure Telegram Bot Node

In the Latenode visual builder, add a Telegram Bot node and configure it to use the Telegram credential you added.

3

Add Supabase Credential

Add your Supabase API key and environment as a credential in the Latenode Credentials panel.

4

Configure Supabase Node

In the Latenode visual builder, add a Supabase node and configure it to use the Supabase credential you added. Set up the database connection and any necessary queries.

5

Add OpenAI Credential

Add your OpenAI API key as a credential in the Latenode Credentials panel.

Requirements

Telegram bot API key and access to the Telegram Bot API
OpenAI API key and access to the GPT-4 model
Supabase account and access to the Supabase API, including the ability to create and query a vector database
Ability to handle and process various file types, including text, audio, images, and documents

FAQ

Common questions about this template

Each run uses credits on your Latenode plan. We charge for processing time (1 credit = 30 seconds). Your actual cost depends on your plan and how long the run takes. See pricing plans for plans and how credits work.

More templates

You might also like

Browse all templates →
Messaging & bots

Automate WhatsApp Sales with AI Chatbots and Product Data

This Latenode automation allows users to build a WhatsApp chatbot that acts as a sales agent, providing automated responses to customer inquiries. The chatbot is powered by a product catalog vector store and an AI language model, allowing it to understand and respond to user messages in real-time. The workflow involves importing a product brochure, extracting the text, creating a vector store, and using the OpenAI language model and a memory buffer to generate relevant responses to WhatsApp users. The chatbot can handle both text messages and non-text messages, with the latter triggering a standard response. This automation is designed for businesses looking to enhance their customer support and sales efforts through a conversational WhatsApp interface.

26s$0.0703
Messaging & bots

Instantly sync Facebook Messenger to your WhatsApp for real-time alerts

This automation allows users to automatically send incoming Facebook Messenger messages to a specified WhatsApp account as real-time notifications. It is designed for users who need to stay on top of their Facebook Messenger communications while on the go, allowing them to respond quickly via WhatsApp. The automation integrates with Facebook Messenger and WhatsApp to monitor for new messages and forward them to the designated WhatsApp contact.

26s$0.0703
Messaging & bots

Automate Telegram Chatbots with AI-Powered Responses

This AI-powered Telegram bot aims to provide instant, relevant replies to user messages by integrating with advanced AI models. The bot will analyze incoming messages and generate appropriate responses tailored to the user's queries, drawing from the capabilities of language models and other AI technologies. This solution is designed to streamline communication and enhance the user experience within the Telegram messaging platform, offering an intelligent and conversational interface that can handle a wide range of user inquiries efficiently.

26s$0.0703