Developer & DevOps

Process Telegram Messages with OpenAI and Send Automated Replies

16 nodes 352 195 Automatic trigger
Download

Workflow Description

Automation that listens for new messages in a Telegram channel, processes them through OpenAI's language model, and sends intelligent replies back to users. Distinguishes between message types and routes them according to content.

How it works

  1. 1.Capture incoming messages from the specified Telegram channel or bot
  2. 2.Evaluate message type and categorize based on content
  3. 3.Submit the message to OpenAI for processing and obtain an intelligent response
  4. 4.Format and refine the response according to application requirements
  5. 5.Deliver the final reply to the user via Telegram

Use cases

  • Intelligent Telegram bot that answers user questions without manual intervention
  • Automated customer inquiry handling with consistent, AI-generated responses
  • 24/7 support tool that manages questions in Telegram groups and channels

Requirements

  • Active Telegram account with a channel or group that has bot administration permissions
  • Valid OpenAI API key (compatible with gpt-3.5 or newer models)
  • Telegram credentials configured in n8n

Service Value

Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.

Apps Used

Telegram OpenAI

Details

Trigger Automatic trigger
Nodes 16
Apps 2
Views 352
Downloads 195

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 (16)

/

Telegram Trigger

Set

#1

CheckCommand

Switch

#2

Sticky Note

Sticky Note

#3

Settings

Set

#4

Sticky Note1

Sticky Note

#5

Sticky Note2

Sticky Note

#6

Chat_mode

OpenAI

#7

Greeting

OpenAI

#8

Text reply

Set

#9

Send Typing action

Set

#10

Merge

Merge

#11

Sticky Note3

Sticky Note

#12

Create an image

OpenAI

#13

Send error message

Set

#14

Send image

Set

#15

PreProcessing

Set

#16