Skip to main content

Telegram chatbot with voice recognition and message batching using OpenAI

Workflow preview

Workflow preview
100%
Telegram chatbot with voice recognition and message batching using OpenAI preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This Telegram workflow batches rapid fire messages from the same user into one prompt (20–30s debounce), then sends a single AI reply. It uses two Google Sheets : Message Retention ( ) — queues inc...

Best for

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

Tools used

n8n-nodes-base.set, n8n-nodes-base.if, n8n-nodes-base.merge, n8n-nodes-base.telegram, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.googlesheets, @n8n/n8n-nodes-langchain.embeddingsopenai, @n8n/n8n-nodes-langchain.lmchatopenai

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Telegram chatbot with voice recognition and message batching using OpenAI
Workflow name
Telegram chatbot with voice recognition and message batching using OpenAI

This Telegram workflow batches rapid-fire messages from the same user into one prompt (20–30s debounce), then sends a single AI reply.

It uses two Google Sheets:

  • Message Retention (date | user_id | message) — queues incoming messages.
  • Message Checkup (user_id | is_waiting | last_updated) — debounces per user.

Flow per message:

  1. Log to Message Retention.
  2. Read Message Checkup for that user_id. If empty, synthesize { is_waiting:false }.
  3. IF (OR):
    • last_updated is older than 30s, or
    • is_waiting is false
      → Start wait window: set is_waiting=true, update last_updated, Wait (e.g., 30s).
  4. After Wait: fetch all queued messages for the user, merge them, delete those rows, send one AI answer to Telegram, then clear the Waiting row.
  5. If a new message arrives while waiting, we only refresh last_updated (extend the window) — we do not start another wait.

Copy/paste:

  • Older-than-30s: {{ new Date(Date.now() - 30000).toISOString() }}
  • “No Rows” normalizer (Code node) ensures the IF always has data to check.

Supports text and voice (voice via Whisper). Works reliably on Telegram once the webhook is registered and Sheets are shared with the service account.

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 - Pass text message

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 2 - Link Filter

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

Block 3 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.1

Block 4 - Edit Fields

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 5 - Transcript Error Output

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 6 - Transcript Result

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 7 - Get Audio File

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

Block 8 - Transcribe a recording

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

Block 9 - Append row in sheet

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

Block 10 - Get row(s) in sheet

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

Block 11 - Embeddings OpenAI1

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

Block 12 - OpenAI Chat Model

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

Block 13 - AI Agent

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

Block 14 - Get row(s) in sheet1

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

Block 15 - What to do

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

Block 16 - Update row in sheet

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

Block 17 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 18 - Delete rows or columns from sheet1

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

Block 19 - Update row in sheet1

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

Block 20 - No Rows

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

Block 21 - Batch Messages

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

Block 22 - Sticky Note

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

Block 23 - Sticky Note1

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

Block 24 - Simple Memory

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

Showing the first 24 of 31 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Telegram chatbot with voice recognition and message batching using OpenAI
Complexity advanced
Nodes 31
Categories Support Chatbot, AI Chatbot
Author Kirill Zolygin
Published 05 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8314/8314.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 Telegram chatbot with voice recognition and message batching using OpenAI do?

This Telegram workflow batches rapid fire messages from the same user into one prompt (20–30s debounce), then sends a single AI reply. It uses two Google Sheets : Message Retention ( ) — queues inc...

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.