🤖 Telegram Subscriber Onboarding — Automated CRM Engine
/Onboard users (captures chat_id once).png)
Telegram Subscriber Onboarding is a foundational automation for any Telegram-based community or digital service. Built on n8n, this system acts as a high-speed Customer Relationship Management (CRM) entry point. It automates the entire lifecycle of a new subscriber—from identifying their unique chat ID to validating their existence in a secure database and delivering a hyper-personalized welcome experience.
By orchestrating interactions between the Telegram Bot API and Google Sheets, this workflow ensures 100% data integrity with zero manual oversight.
🛠️ Technology Stack
✨ Features at a Glance
📡 Real-Time Webhook Trigger
- Instant Activation: Captures inbound Telegram messages with sub-second latency.
- Deep Metadata Extraction: Automatically parses the raw JSON payload to isolate
chat_id,first_name,username, andlast_namefor precise CRM logging.
📂 Google Sheets CRM Integration
- Smart Validation: Instantly queries your central “Subscribers” Google Sheet to check if the current user already exists.
- Branching Logic: Uses an
Ifnode to intelligently route the workflow:- New Users: Appends their row to the CRM and triggers a welcome sequence.
- Returning Users: Identifies them by unique ID and skips the onboarding process to avoid spamming.
- Secure Data Storage: Uses OAuth2 authentication for enterprise-grade security when writing to sheets.
💬 Personalized Messaging Engine
- Dynamic Variable Injection: Uses
{{$json.first_name}}to address the user directly, increasing engagement. - Rich Media Support: Configured to send everything from text-based instructions to complex keyboard interfaces.
- Status Updates: Sends immediate confirmation messages (e.g., ”✅ You’re now subscribed!”) to brand-new members.
📁 Workflow Architecture
telegram-onboarding/
├── Telegram Webhook [Trigger] # Listens for /start
├── Google Sheets [Look up] # Checks for existing Chat ID
├── Logic Filter [If/Else] # Determines User Status
├── Google Sheets [Append] # Saves New User Data
└── Telegram Send [Action] # Dispatches Personalized Welcome
🚀 Installation & Setup
1. Prerequisites
- n8n Instance (Desktop or Self-hosted)
- Telegram Bot Token (Create one via @BotFather)
- Google Cloud Console Project (Enabled Google Sheets API)
2. Workflow Import
- Download the
onboarding-workflow.jsonfrom this repository. - In n8n, click “Add Workflow” -> “Import from File”.
- Select the JSON file.
3. Connection Config
- Telegram Node: Click and select “Add Credentials”, paste your Bot Token.
- Google Sheets Node: Follow the n8n guide for OAuth2 to link your Google account.
- Sheet ID: Replace the placeholder Sheet ID with the ID of your “Subscribers” spreadsheet.
4. Activation
- Switch the workflow toggle to “Active”.
- Open your bot in Telegram and type
/start. Your name should instantly appear in your Google Sheet!
📄 License
Distributed under the MIT License.
Designed & Developed by Aditya (aka aditya-2129)