Connect Telegram with OpenAI
Workflow Description
Advanced template connecting Telegram accounts with OpenAI's AI models, enabling users to interact with an intelligent agent through instant messaging. The template supports persistent memory, custom tools, and multiple integrations to enhance performance and intelligence capabilities.
How it works
- 1.Receive messages from Telegram channels via the trigger
- 2.Process content through an OpenAI intelligent agent with saved conversation memory
- 3.Send responses automatically back to the user via Telegram
- 4.Use external tools (Google Tasks, MCP) to execute tasks
- 5.Store logs and data in a Postgres database
- 6.Integrate with Evolution API and OpenRouter for additional options
Use cases
- Build a smart assistant that automatically responds to customer inquiries on Telegram
- Create a bot that manages tasks and reminders while maintaining context across multiple conversations
Requirements
- Active Telegram Bot account and API token
- Valid API keys from OpenAI and/or LM Chat Open Router
- Available Postgres database for persistent memory
- (Optional) Accounts in Google Tasks or Evolution API
Service Value
Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.
Apps Used
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (38)
OpenAI Chat Model1
OpenAI
Assistente clinica interno
Agent
Google Tasks
Google Tasks Tool
MCP Google Calendar
Mcp Client Tool
Receber Mensagem Telegram
Set
Postgres Chat Memory
Memory Postgres Chat
OpenAI Chat Model
OpenAI
Assistente Clínica
Agent
Enviar alerta de cancelamento
Set
Gatilho diário
Schedule Trigger
Assistente de confirmação
Agent
AI Agent
Agent
Sticky Note
Sticky Note
Sticky Note2
Sticky Note
Sticky Note3
Sticky Note
Postgres Chat Memory1
Memory Postgres Chat
MCP Google Calendar2
Mcp Client Tool
MCP GMAIL
Mcp Client Tool
MCP CALENDAR
Mcp Client Tool
Telegram
Set
OpenRouter Chat Model1
Lm Chat Open Router
Webhook1
Webhook
Edit Fields1
Set
Switch
Switch
Sticky Note5
Sticky Note
OpenAI
OpenAI
Evolution API
Evolution Api
Convert to File
Convert To File
Sticky Note1
Sticky Note
Sticky Note6
Sticky Note
OpenAI1
OpenAI
AI Agent2
Agent
OpenRouter Chat Model2
Lm Chat Open Router
Evolution API2
Evolution Api
Sticky Note4
Sticky Note
CallToHuman
Tool Workflow
OpenAI Chat Model2
OpenAI
REMINDER
Evolution Api