AI Agents

Connect Telegram with OpenAI

48 nodes 204 123 Webhook
Download

Workflow Description

An advanced automation template connecting Telegram with OpenAI's intelligent models, enabling smart message processing through an AI agent with memory support, tool integration, and Postgres database persistence for conversation context tracking.

How it works

  1. 1.Receive Telegram messages via webhook and transform them into processing requests
  2. 2.Send messages to OpenAI intelligent agent with integrated tools and database access
  3. 3.Store conversation context in Postgres and return final response to the user

Use cases

  • Smart Telegram chatbot answering customer inquiries using advanced natural language processing
  • Automated support system maintaining conversation history and customer context across multiple sessions

Requirements

  • Valid OpenAI API key and Telegram Bot token
  • Postgres database configured to store memory and conversation contexts

Service Value

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

Apps Used

OpenAI Telegram AI Agent Postgres Tool Baserow Memory

Details

Trigger Webhook
Nodes 48
Apps 7
Views 204
Downloads 123

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

/

Sticky Note7

Sticky Note

#1

Sticky Note8

Sticky Note

#2

Sticky Note9

Sticky Note

#3

gpt-4o-mini

OpenAI

#4

Chat Response

Set

#5

Sticky Note

Sticky Note

#6

Telegram Response

Set

#7

Sticky Note1

Sticky Note

#8

Sticky Note2

Sticky Note

#9

AI Tools Agent

Agent

#10

Sticky Note10

Sticky Note

#11

Sticky Note11

Sticky Note

#12

Aggregate

Aggregate

#13

Merge

Merge

#14

Sticky Note5

Sticky Note

#15

Sticky Note3

Sticky Note

#16

Get Audio File

Set

#17

Analyze Image

OpenAI

#18

Transcribe Recording

OpenAI

#19

Edit Fields

Set

#20

Convert to Image File

Convert To File

#21

Extract from File to Base64

Extract From File

#22

Sticky Note12

Sticky Note

#23

Sticky Note6

Sticky Note

#24

Message Router

Switch

#25

Image Schema1

Set

#26

caption

Split Out

#27

Merge1

Merge

#28

Get Image

Set

#29

Edit Fields1

Set

#30

Sticky Note13

Sticky Note

#31

Sticky Note14

Sticky Note

#32

Postgres Chat Memory

Memory Postgres Chat

#33

Save Note Tool

Baserow Tool

#34

Save Memory

Baserow Tool

#35

Listen for Telegram Events

Webhook

#36

Validation

Set

#37

Check User & Chat ID

If

#38

Sticky Note15

Sticky Note

#39

Error message

Set

#40

Baserow Retrieve Memories

Baserow

#41

Baserow Retrieve Notes

Baserow

#42

Window Memory (Easy Mode)

Memory Buffer Window

#43

Sticky Note4

Sticky Note

#44

Sticky Note16

Sticky Note

#45

Sticky Note17

Sticky Note

#46

Sticky Note18

Sticky Note

#47

Sticky Note19

Sticky Note

#48