AI Agents

Build an intelligent Telegram bot with AI agent

8 nodes 315 164 Automatic trigger
Download

Workflow Description

This template connects your Telegram bot to OpenAI's language model for intelligent message processing, maintains conversation context in sliding memory, and executes advanced external actions via HTTP requests.

How it works

  1. 1.Receive new Telegram messages through the bot trigger
  2. 2.Process messages using an AI agent powered by OpenAI's model
  3. 3.Retain conversation history in a sliding memory buffer for better responses
  4. 4.Execute external actions through HTTP requests when needed
  5. 5.Send intelligent replies back to the user in Telegram

Use cases

  • Customer support bot that answers inquiries automatically with contextual understanding
  • Personal assistant that reads previous conversations and provides consistent answers
  • Bot that integrates with external systems to fetch data or perform operations

Requirements

  • OpenAI API key to power the language model
  • Telegram Bot Token from BotFather for authentication
  • Internet connectivity to call external APIs and services

Service Value

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

Apps Used

OpenAI Memory Telegram HTTP Request AI Agent

Details

Trigger Automatic trigger
Nodes 8
Apps 5
Views 315
Downloads 164

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

OpenAI Chat Model

OpenAI

#1

Window Buffer Memory

Memory Buffer Window

#2

Listen for incoming events

Set

#3

Sticky Note

Sticky Note

#4

Send final reply

Set

#5

Send back an image

Set

#6

Generate image in Dalle

HTTP Request

#7

AI Agent

Agent

#8