workflows.fit
Back to n8n workflows
n8n templateFreeBy IvanCore

Automated Telegram UserBot session monitoring & recovery with TelePilot

![image.png](fileId:1786) Disclaimer: This workflow contains community nodes that are only compatible with the self-hosted version of n8n. Important distinction: This template manages Telegram Copilot's UserBots (clie...

CommunicationHITLCore NodesLangchainChat TriggerSticky NoteSchedule Trigger@telepilotco/n8n-nodes-telepilot.tele Pilot
Loading interactive preview...

Template notes

![image.png](fileId:1786) Disclaimer: This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Important distinction: This template manages Telegram Copilot's UserBots (client accounts), not Telegram Bots. UserBot vs. Bot: Key Differences 🔹 Telegram Copilot's UserBots - Authenticate as real user accounts (phone number required) - Can join groups/channels without "Bot" label - Subject to Telegram's client API limits - Require manual login (MFA supported) 🔹 Telegram Bots - Use @BotFather-created tokens - Limited to bot API functionality - Can't initiate chats with unbidden users - No phone number required This template solves the unique challenges of UserBot management through: Core Functionality 🛡️ Session Reliability - Automatic crash recovery (5-step restart sequence) - Persistent session monitoring (checks every 6h) - Database cleanup via /clear command 📱 Multi-Device Support - Manages sessions independently from mobile clients - Tracks active devices via /stat command - Isolates session data per credential

🔔 Smart Notifications - Real-time alerts to admin chat - Detailed error context with authState snapshots - Success confirmations with session metadata Setup Guide Prerequisites - Self-hosted n8n instance (community node required) - Valid Telegram account for UserBot - Telegram bot token for notifications - TelePilot credentials with apiid/apihash Configuration Steps Credential Setup - Add TelePilot credentials in n8n - Configure Telegram bot token in notification nodes - Set admin chat ID for alerts Monitoring Customization - Adjust check frequency in Schedule Trigger - Modify alert thresholds in Filter nodes - Configure retry logic in recovery sequence Session Management - Test /start command flow - Verify /stat output format - Confirm notification delivery

Workflow Customization Advanced Options - Add secondary notification channels (Email, Slack) - Implement escalating alert system - Integrate with monitoring dashboards - Customize recovery attempt limits Compliance Notes - UserBots must comply with Telegram's Terms of Service - Not intended for bulk messaging or spam - Recommended for legitimate automation use cases

Note: UserBots must comply with Telegram ToS. Not for spam/mass messaging.

Why This Matters: UserBots enable automation scenarios impossible with regular bots (e.g., group management as normal user, reacting as human account). This workflow keeps them reliably online 24/7.