Automate Multilingual Telegram Bot Responses with n8n
detail.loadingPreview
This n8n workflow automates responses for a multilingual Telegram bot, ensuring users receive messages in their preferred language. It leverages NocoDB for message storage and user management, providing a robust foundation for international communication.
About This Workflow
This n8n workflow orchestrates a multilingual Telegram bot, offering personalized interactions based on user language. Upon receiving a message via the Telegram Trigger, it first loads bot messages from a NocoDB table (botmessages) and then checks for existing users in another NocoDB table (TG_users). Depending on whether the user is new or returning, and the command received (/start, /help, or an invalid command), the bot sends appropriate multilingual responses. This ensures users receive greetings, help messages, or error notifications tailored to their language setting, enhancing user experience and global reach.
Key Features
- Dynamic Language Handling: Automatically detects and utilizes user's Telegram language code for responses.
- Multilingual Message Management: Stores bot messages in NocoDB for easy updates and additions across multiple languages.
- New User Onboarding: Automatically adds new users to the
TG_usersNocoDB table upon their first interaction. - Command Routing: Intelligently handles
/start,/help, and unknown commands with specific, translated responses. - Data Persistence: Leverages NocoDB for reliable storage of user data and bot messages.
How To Use
- Set up Telegram Bot: Create a bot via BotFather and obtain the API token. Configure this in the
Telegram Triggerand Telegram nodes. - Configure NocoDB: Set up a NocoDB instance with two tables:
TG_users(to store user IDs and language) andbotmessages(to store multilingual bot responses keyed by message type and language code). - Connect NocoDB Credentials: Add your NocoDB API credentials to n8n.
- Configure
Telegram Trigger: Set up theTelegram Triggernode with your bot token and specifymessageupdates. - Load Bot Messages: The
LoadDictionaryandbotmessagesnodes fetch and structure your multilingual messages from NocoDB. - Extract Chat ID and Language: The
chatIDfunction node extracts the chat ID and determines the user's language, defaulting to English if unsupported. - Check User Status: The
CheckUsernode queries NocoDB to see if the user already exists. - Determine New User: The
IFnode checks if the user is new based on theCheckUseroutput. - Handle Commands: The
Switchnode routes messages based on the command (/start,/help). - Send Responses: The
msg_greet,msg_welcomeback,msg_help, andmsg_wrongcommandnodes send appropriate, language-specific messages back to the user via Telegram. - Add/Update User: The
HTTP AddUserandHTTP UpdateUsernodes manage user records in theTG_usersNocoDB table.
Apps Used
Workflow JSON
{
"id": "afb5e3e9-3df4-4e28-8145-bdaeaa8a6a6b",
"name": "Automate Multilingual Telegram Bot Responses with n8n",
"nodes": 15,
"category": "DevOps",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: afb5e3e9-3df4...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Automate Qualys Report Generation and Retrieval
Streamline your Qualys security reporting by automating the generation and retrieval of reports. This workflow ensures timely access to crucial security data without manual intervention.
Automated PR Merged QA Notifications
Streamline your QA process with this automated workflow that notifies your team upon successful Pull Request merges. Leverage AI and vector stores to enrich notifications and ensure seamless integration into your development pipeline.
Visualize Your n8n Workflows: Interactive Dashboard with Mermaid.js
Gain unparalleled visibility into your n8n automation landscape. This workflow transforms your n8n instance into a dynamic, interactive dashboard, leveraging Mermaid.js to visualize all your workflows in one accessible place.