Telegram Chatbot with OpenAI Assistant and Supabase Storage
detail.loadingPreview
This workflow creates a Telegram chatbot that interacts with an OpenAI Assistant and stores user data in Supabase.
🚀Ready to Deploy This Workflow?
About This Workflow
Overview
This n8n workflow enables you to build a Telegram chatbot that leverages the power of OpenAI Assistants for intelligent conversations. It also integrates with Supabase to manage user data, creating a new OpenAI thread for each new user and storing their telegram_id and openai_thread_id.
Key Features
- Telegram Integration: Trigger workflows with new Telegram messages.
- OpenAI Assistant Interaction: Create OpenAI threads and run assistants for dynamic responses.
- User Data Management: Store and retrieve Telegram user information with their corresponding OpenAI thread IDs using Supabase.
- Conditional Logic: Checks if a user already exists in the database before creating a new OpenAI thread.
How To Use
- Set up a Telegram Bot: Use the BotFather to create a Telegram bot and obtain the bot token.
- Set up Supabase: Create a Supabase project and a
telegram_userstable withtelegram_idandopenai_thread_idcolumns. Use the provided SQL query. - Create an OpenAI Assistant: Configure an assistant in your OpenAI account.
- Configure n8n Nodes: Update the
telegramApiandsupabaseApicredentials in the respective nodes. - Set Environment Variables: Ensure
$env.API_BASE_URLand$env.BASE_URLare correctly set for OpenAI API calls. - Specify Assistant ID: In the 'OPENAI - Run assistant' node, replace
'asst_b0QhuzySG6jofHFdzPZD7WEz'with your actual assistant ID. - Activate the Workflow: Trigger the workflow by sending a message to your Telegram bot.
Apps Used
Workflow JSON
{
"id": "f79c6143-a065-4f40-8d29-3f8644f51736",
"name": "Telegram Chatbot with OpenAI Assistant and Supabase Storage",
"nodes": 0,
"category": "Chatbots",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: f79c6143-a065...
About the Author
SaaS_Connector
Integration Guru
Connecting CRM, Notion, and Slack to automate your life.
Statistics
Verification Info
Related Workflows
Discover more workflows you might like
Bitrix24 Chatbot Application Workflow with Webhook Integration
Integrates a Bitrix24 chatbot with n8n using webhooks for real-time message handling.
Automate Shipment Tracking with Telegram and n8n
Streamline your logistics operations by automating shipment tracking with Telegram and n8n. This workflow allows drivers to easily share updates, and ensures timely notifications to your team.
Telegram Profanity & Toxicity Filter
This n8n workflow automatically monitors incoming Telegram messages for profanity and toxic language. It leverages Google's Perspective API to analyze message content, and if a message is deemed inappropriate, the workflow sends an automated warning response back to the sender.
Automate Instagram Reel Analysis with Gemini and Apify
Unlock deeper insights into your Instagram Reels by automating analysis. This workflow leverages Apify to fetch reel data and Gemini AI to dissect key elements like background, pose, text, and context, enabling better content replication.
AI-Powered PostgreSQL Data Agent with Conversational Interface
This n8n workflow empowers you to build an intelligent, conversational agent for your PostgreSQL database. Interact with your data using natural language, perform CRUD operations, explore schemas, and generate dynamic visualizations, streamlining data management and access for any user.
AI-Powered YouTube Video Metadata Automation
Effortlessly optimize your YouTube videos for search and engagement. This workflow automates the generation of SEO-friendly titles, descriptions, tags, and hashtags using AI, directly updating your YouTube content based on video transcripts and focus keywords.