Function Automate

Function Automate streamlines user interactions on Telegram by automatically managing user data and responding to commands in multiple languages. It efficiently integrates with NocoDb to track user activity and provide personalized greetings, ensuring a seamless communication experience. This workflow enhances user engagement by delivering timely responses and support, ultimately improving user satisfaction and retention.

7/8/2025
18 nodes
Complex
manualcomplextelegramnocodbtelegramtriggersticky noteadvancedcodecustomlogicroutingconditionalcommunicationbotapiintegration
Categories:
Communication & MessagingComplex WorkflowManual Triggered
Integrations:
TelegramNocoDbTelegramTriggerSticky Note

Target Audience

Target Audience


- Telegram Bot Developers: Those who want to create interactive bots that respond to user commands in multiple languages.
- Small Business Owners: Entrepreneurs looking to automate customer interactions through Telegram.
- Community Managers: Individuals managing Telegram groups or channels who need automated responses to common queries.
- Developers and Tech Enthusiasts: People interested in integrating APIs and creating automated workflows using n8n and NocoDB.

Problem Solved

Problem Solved


This workflow addresses the challenge of managing user interactions in a Telegram bot by:
- Automating Responses: Automatically replies to users based on their commands, improving user engagement.
- Multi-language Support: Provides responses in the user's preferred language, enhancing user experience.
- User Management: Keeps track of user data and interactions, allowing for personalized communication.

Workflow Steps

Workflow Steps


1. Trigger: The workflow starts when a message is received in the Telegram bot.
2. Extract User Info: The chatID node extracts the user's chat ID and language preference from the incoming message.
3. Load Dictionary: The LoadDictionary node retrieves predefined messages in multiple languages from the NocoDB database.
4. Check User Status: The CheckUser node checks if the user is new or returning by querying the TG_users table in NocoDB.
5. Conditional Logic: The Switch node directs the flow based on the user's command (e.g., /start, /help).
6. User Management: If the user is new, the HTTP AddUser node creates a new entry in the database. If the user is returning, the HTTP UpdateUser node updates their last used language.
7. Send Response: Depending on the command, the bot sends a greeting, help message, or a response for an unrecognized command using the appropriate msg_* nodes.
8. Merge and Finalize: The Merge node consolidates data and prepares it for the next steps, ensuring a smooth flow of information.

Customization Guide

Customization Guide


- Modify Responses: Update the botmessages table in NocoDB to change the bot's responses for different commands.
- Add New Commands: Extend the Switch node rules to include new commands that the bot should recognize.
- Update Language Support: Add new languages to the botlang array in the chatID function code to support more languages.
- Change Database Structure: If you want to store additional user information, modify the TG_users table in NocoDB accordingly and update the HTTP request nodes to include new fields.
- Test and Debug: Use n8n's built-in debugging tools to test your workflow and make adjustments as necessary.