AI Agents

Respond to Telegram Messages with an OpenAI-Powered Smart Agent

38 nodes 274 146 Automatic trigger
Download

Workflow Description

This automation connects your Telegram account to an intelligent agent powered by OpenAI, enabling smart responses to incoming messages with contextual awareness. Conversation history is stored in Postgres for continuous learning and reference.

How it works

  1. 1.Receive and validate incoming Telegram messages
  2. 2.Route messages to OpenAI agent with stored conversation context
  3. 3.Generate and send intelligent replies back through Telegram

Use cases

  • Build a fully automated customer support bot that responds intelligently on Telegram
  • Create a multi-purpose bot that learns and improves from past conversations

Requirements

  • Active Telegram account with bot creation permissions
  • Valid OpenAI API key with appropriate usage limits
  • Postgres database configured to store and retrieve conversation history

Service Value

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

Apps Used

OpenAI AI Agent Tool Telegram Postgres Lm Chat Open Router Evolution Api

Details

Trigger Automatic trigger
Nodes 38
Apps 7
Views 274
Downloads 146

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

/

OpenAI Chat Model1

OpenAI

#1

Assistente clinica interno

Agent

#2

Google Tasks

Google Tasks Tool

#3

MCP Google Calendar

Mcp Client Tool

#4

Receber Mensagem Telegram

Set

#5

Postgres Chat Memory

Memory Postgres Chat

#6

OpenAI Chat Model

OpenAI

#7

Assistente Clínica

Agent

#8

Enviar alerta de cancelamento

Set

#9

Gatilho diário

Schedule Trigger

#10

Assistente de confirmação

Agent

#11

AI Agent

Agent

#12

Sticky Note

Sticky Note

#13

Sticky Note2

Sticky Note

#14

Sticky Note3

Sticky Note

#15

Postgres Chat Memory1

Memory Postgres Chat

#16

MCP Google Calendar2

Mcp Client Tool

#17

MCP GMAIL

Mcp Client Tool

#18

MCP CALENDAR

Mcp Client Tool

#19

Telegram

Set

#20

OpenRouter Chat Model1

Lm Chat Open Router

#21

Webhook1

Webhook

#22

Edit Fields1

Set

#23

Switch

Switch

#24

Sticky Note5

Sticky Note

#25

OpenAI

OpenAI

#26

Evolution API

Evolution Api

#27

Convert to File

Convert To File

#28

Sticky Note1

Sticky Note

#29

Sticky Note6

Sticky Note

#30

OpenAI1

OpenAI

#31

AI Agent2

Agent

#32

OpenRouter Chat Model2

Lm Chat Open Router

#33

Evolution API2

Evolution Api

#34

Sticky Note4

Sticky Note

#35

CallToHuman

Tool Workflow

#36

OpenAI Chat Model2

OpenAI

#37

REMINDER

Evolution Api

#38