Skip to main content

Reply to Telegram text and voice messages with an OpenAI GPT-4o-mini chatbot and memory

Workflow preview

Workflow preview
100%
Reply to Telegram text and voice messages with an OpenAI GPT-4o-mini chatbot and memory preview
Open on n8n.io

1. Workflow Overview

Quick Overview This workflow listens for incoming Telegram messages, sends each message to an OpenAI chat model via an AI agent with per chat memory, and replies in the same Telegram conversation w...

Best for

  • Support Chatbot automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.telegramtrigger, n8n-nodes-base.if, n8n-nodes-base.telegram, @n8n/n8n-nodes-langchain.openai, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.memorybufferwindow

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by TakatoYamada.

Original n8n.io source

1.1 Workflow description

Title
Reply to Telegram text and voice messages with an OpenAI GPT-4o-mini chatbot and memory
Workflow name
Reply to Telegram text and voice messages with an OpenAI GPT-4o-mini chatbot and memory

Quick Overview

This workflow listens for incoming Telegram messages, sends each message to an OpenAI chat model via an AI agent with per-chat memory, and replies in the same Telegram conversation with a concise, language-matched response.

How it works

  1. Triggers when a new Telegram message is received by your bot.
  2. Sends the message text to an AI chatbot agent configured with a system prompt to respond concisely in the user’s language.
  3. Uses the OpenAI GPT-4o-mini chat model to generate the response and a per-chat memory buffer keyed by Telegram chat ID to retain recent context.
  4. Posts the generated reply back to the originating Telegram chat.

Setup

  1. Create a Telegram bot with BotFather, then add your Telegram bot credentials to the Telegram Trigger and Telegram reply nodes.
  2. Add your OpenAI credentials and select the desired model in the OpenAI chat model node.
  3. Ensure the workflow has access to store conversation context and adjust the memory window length or system message if needed.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - When Message Received

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.2

Block 7 - If Voice Message

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 8 - Download Telegram Voice

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 9 - Transcribe Voice with OpenAI

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.4

Block 10 - AI Conversation Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.7

Block 11 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 12 - Manage Conversation Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 13 - Fetch Information from Wikipedia

Type / Role
@n8n/n8n-nodes-langchain.toolWikipedia - toolWikipedia
Config choices
Version 1

Block 14 - Perform Calculations

Type / Role
@n8n/n8n-nodes-langchain.toolCalculator - toolCalculator
Config choices
Version 1

Block 15 - Send Response via Telegram

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 16 - Append Log to Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.5

3. Summary Table

Workflow Reply to Telegram text and voice messages with an OpenAI GPT-4o-mini chatbot and memory
Complexity advanced
Nodes 16
Categories Support Chatbot, AI Chatbot
Author TakatoYamada
Published 30 May 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/16023/16023.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Reply to Telegram text and voice messages with an OpenAI GPT-4o-mini chatbot and memory do?

Quick Overview This workflow listens for incoming Telegram messages, sends each message to an OpenAI chat model via an AI agent with per chat memory, and replies in the same Telegram conversation w...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Support Chatbot, AI Chatbot use case.