Telegram AI Assistant Input and Session Manager - n8n Workflow

This production-ready n8n workflow processes incoming Telegram messages and voice notes, handles multilingual input via Google STT, and manages user sessions using Redis and Postgres databases. Download this robust n8n templates for advanced AI integrations.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Developers building production-grade AI chatbots or call centers.

  • Automation specialists needing advanced session management in an n8n workflow.

  • Users who require seamless transcription of voice inputs using Google STT within an n8n node flow.

  • Anyone looking for proven n8n templates for complex Telegram integrations.

Overview

Building scalable AI call centers requires more than just connecting to a language model; it demands reliable session management and robust input handling across various media types. This specialized n8n workflow solves this by acting as the intelligent entry point for Telegram users.

It ensures that every user interaction, whether text or voice, is properly attributed, cached, and prepared for the downstream AI service. The workflow intelligently uses Redis for rapid session caching and Postgres for persistent user data, dramatically improving performance for conversational AI. By integrating Google Speech-to-Text (STT) and routing based on message type, this n8n automation provides a foundation for high-quality, multilingual customer interaction systems.

How it Works

This highly sophisticated n8n workflow begins with the Telegram Trigger n8n node.


  1. Session Lookup: Upon receiving a message, the workflow immediately attempts to load user data from the Member Cache (Redis n8n node). If the cache hit fails, it falls back to the Load Memer Data (Postgres n8n node) to retrieve the user's details, including their language settings. This data is then saved back to Redis using the Save Member Cache n8n node, ensuring fast access for subsequent messages.


  1. Input Classification: The Type Switch n8n node checks if the input is a standard text message or an audio/voice note.


  1. Voice Processing: If the input is audio, the Download Audio n8n node fetches the file. It then proceeds through a Switch n8n node which determines the appropriate language configuration (supporting English, Mandarin, Cantonese, Japanese) for the Google STT n8n node.


  1. Transcription Check: The If Transcript n8n node verifies successful transcription. If successful, the transcribed text is formatted via the Telegram Voice Input n8n node and passed to the main system. If transcription fails, the No Transcript Input n8n node triggers a fallback process via the Demo Call Back n8n node.


  1. Final Routing: Regardless of whether the input originated as text or was transcribed from voice, the data is standardized and passed to the Demo Call Center n8n node via an Execute Workflow n8n node. This ensures the centralized AI logic receives clean, standardized input, making this n8n template highly modular and effective.

Installation Guide


  1. Import the n8n Workflow: Copy the provided JSON and import it into your n8n instance via the 'New' menu > 'Import from JSON'.

  2. Telegram Setup: Activate the Telegram Trigger n8n node and set up your Telegram Bot API credentials. This will generate a webhook URL that must be configured with your bot (@chpydemobot is noted in the JSON).

  3. Credential Configuration: You will need to configure credentials for the following services:

Redis: For the Member Cache and Save Member Cache n8n node credentials.
Postgres: For the Load Memer Data n8n node (used for persistent session storage).
* Google Speech-to-Text: For the Google STT n8n node.

  1. Sub-Workflow Linking: Ensure the referenced sub-workflows (Demo Call Center and Demo Call Back) are also deployed and accessible. The Execute Workflow n8n node relies on these internal links.

  2. Activation: Once all credentials are set and connections are verified, activate the main n8n workflow to start processing Telegram inputs.

Node Details

Telegram Trigger (n8n trigger): The starting point of the n8n workflow, configured to listen for all incoming messages (text, voice, etc.) from the specified Telegram bot.
Member Cache (Redis n8n node): Used to check for and store temporary user session data, drastically reducing latency compared to database lookups. Configured with a short TTL (Time To Live).
Load Memer Data (Postgres n8n node): Used as the persistent storage layer for user data, retrieved only if the Redis cache misses.
Type Switch (n8n node): A core logic component that routes the flow based on the type of incoming Telegram message (text vs. voice).
Download Audio (Telegram n8n node): Specific action for voice messages, downloading the audio content before transcription.
Switch (n8n node): Routes the audio file to the correct processing path based on inferred language (e.g., ja-JP, English), setting the appropriate parameters for the STT service.
Google STT (n8n node): Converts the downloaded multilingual audio file into text (Speech-to-Text). Configured with error handling (onError: continueRegularOutput).
If Transcript (n8n node): Determines if the Google STT service returned a valid transcript. Routes successful transcriptions to the AI core or failed attempts to a callback handler.


  • Demo Call Center (Execute Workflow n8n node): The final action for valid input, executing a separate n8n workflow responsible for the core AI interaction logic. This separation is key to efficient modular n8n templates.

Related n8n Workflows

Paid

Nodes: 13 Nodes
Updated: December 26 2025
View all
Created by

Production Ready AI n8n Workflow Templates Startup Fundraising 💰 Support Us 🦄

Featured*