Developer & DevOps

Telegram with Supabase cache and OpenAI Assistant integration

17 nodes 244 142 Automatic trigger
Download

Workflow Description

Automation that receives Telegram messages and stores data in Supabase with caching support, integrating with OpenAI Assistant to process requests and send automated responses back to Telegram.

How it works

  1. 1.Receive message from Telegram using the dedicated trigger
  2. 2.Query Supabase cache and retrieve relevant conversation history
  3. 3.Send message and context to OpenAI Assistant for processing
  4. 4.Merge and format the results appropriately
  5. 5.Write response and metadata to the Supabase database
  6. 6.Send the processed reply back to the user via Telegram

Use cases

  • Intelligent customer support bot that maintains conversation logs in a database
  • Automated command processing leveraging historical interaction data for contextual responses

Requirements

  • Active Telegram account with a registered bot and valid API token
  • Supabase project with configured tables for storing messages and metadata
  • OpenAI API key with Assistant configured and required model settings

Service Value

Ready-made workflow template for automation delivery and service execution.

Apps Used

Telegram Supabase

Details

Trigger Automatic trigger
Nodes 17
Apps 2
Views 244
Downloads 142

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (17)

/

Get New Message

Set

#1

OPENAI - Create thread

HTTP Request

#2

Create User

Supabase

#3

Merge

Merge

#4

OPENAI - Send message

HTTP Request

#5

OPENAI - Run assistant

HTTP Request

#6

OPENAI - Get messages

HTTP Request

#7

Send Message to User

Set

#8

If User exists

If

#9

Find User

Supabase

#10

Sticky Note1

Sticky Note

#11

Sticky Note2

Sticky Note

#12

Sticky Note3

Sticky Note

#13

Sticky Note4

Sticky Note

#14

Sticky Note5

Sticky Note

#15

Sticky Note6

Sticky Note

#16

Sticky Note7

Sticky Note

#17