Developer & DevOps

Connect Telegram with OpenAI

16 nodes 220 117 Automatic trigger
Download

Workflow Description

Automation template that receives messages from Telegram and processes them through OpenAI to generate intelligent responses, then sends them back to the user. Supports handling different message types with conditional logic to control workflow behavior.

How it works

  1. 1.Receive incoming messages from Telegram using the Telegram trigger node
  2. 2.Evaluate message type and content using a switch node to route to the appropriate workflow path
  3. 3.Send the message content to OpenAI for processing and intelligent response generation
  4. 4.Merge results from different processing branches when necessary
  5. 5.Deliver the AI-generated response back to the user via Telegram

Use cases

  • Build an intelligent Telegram assistant that automatically responds to inquiries and questions
  • Process customer requests and generate personalized responses without manual intervention
  • Create a FAQ bot that answers common questions while maintaining conversation context

Requirements

  • Active Telegram account with a valid bot token
  • OpenAI API key with sufficient permissions and usage quota
  • Basic familiarity with configuring variables and conditional logic 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 220
Downloads 117

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