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

Build automated WhatsApp chatbot with product catalog knowledge base

This Latenode automation template builds a WhatsApp chatbot that allows users to interact with a service or database, providing automated responses to inquiries and facilitating real-time communication through the WhatsApp Business API. The chatbot is powered by a product catalog vector store, which serves as a knowledge base to help the AI-driven agent better understand and respond to customer questions. The workflow captures incoming WhatsApp messages, filters out non-text messages, and then uses the product catalog to generate relevant responses that are sent back to the user. This solution can be configured with WhatsApp Business Cloud API and OpenAI API credentials, as well as the URL for the product brochure PDF.

19s$0.0012
Messaging & bots

Automate Telegram messaging and notifications via Zapier schedule

The Zapier Telegram Integration allows users to automatically send scheduled messages, notifications, polls, or photos through a Telegram bot at specific intervals defined within a Zapier workflow. This integration simplifies the process of recurring communication on the Telegram messaging platform, enabling users to set up customizable triggers (e.g., daily, weekly, monthly) to send content to targeted chat IDs. The integration connects the Schedule by Zapier app with the Telegram platform, allowing users to streamline their communication without the need for complex programming.

3s$0.0002
Messaging & bots

Generate and Share ChatGPT-Powered Images on Telegram

This Latenode automation template allows users to generate images using the ChatGPT language model and send those images directly to a Telegram chat or channel. Users provide a text prompt, which is then used by ChatGPT to generate an image. The generated image is then automatically sent to the specified Telegram destination. This template is designed to simplify the process of creating image-based content for Telegram users, combining the capabilities of ChatGPT and Telegram in a single, streamlined workflow.

16s$0.0010