Package Information
Documentation

š Telegram GramPro for n8n
The ultimate MTProto automation engine for n8n. Enterprise-grade security, high-performance userbot triggers, and seamless Telegram integration.
š Operations Guide | š Auth Guide | š§ Troubleshooting | š Logs
š Why Telegram GramPro?
Most Telegram n8n nodes use the standard Bot API, which is restricted by Telegram's bot policies. GramPro uses the MTProto protocol (via Teleproto), allowing you to automate User Accounts and Channels with the full power of a native Telegram client.
š Transform Your Telegram Automation
Telegram GramPro is a comprehensive n8n custom node that brings the full power of Telegram's MTProto protocol to your automation workflows. Built with Teleproto and designed for production use, it offers enterprise-grade features with an intuitive interface.
š Key Features
Core Operations
- Messages: Send, get messages (time-based filters), edit, delete, pin, forward, copy, create polls and quizzes
- Chats: Get chats, dialogs, join/leave, create groups/channels
- Users: Get user info, full details with bio and common chats, update profile, change username, get profile photos
- Media: Download media files with progress tracking
- Channels: Get participants, manage members, ban/promote users
Enterprise Security & Performance
š AES-256-GCM Session Encryption - Military-grade security with automatic key derivation
ā” Smart Rate Limiting - Prevents API limits with intelligent queuing and priority handling
š”ļø Enhanced Error Handling - Automatic retry for flood waits, timeouts, and connection issues
š Connection Management - Advanced client pooling with health checks and auto-reconnection
š Structured Logging - Production-ready logging with configurable levels and context
š§ Smart Caching - In-memory caching for frequently accessed data with TTL management
šÆ Input Validation - Comprehensive validation with detailed error messages and warnings
Deleted Message Trigger - Catch deletions with content recovery via snapshot memory šļø
User Update Trigger - Monitor real-time online/offline status and bio changes š¤
Teleproto Engine - Migrated to a more stable core to handle massive supergroups š”
Topic Support -
Get Historynow supports direct Thread/Topic URLs šCopy Restricted Content - Handle media that cannot be forwarded normally
Edit Message Media - Update media content in existing messages with caption support
Enhanced Authentication - Improved session management with better error handling
Memory Optimization - Automatic cleanup and resource management
Performance Monitoring - Built-in metrics and queue monitoring
š¦ Installation
Method 1: n8n Community Nodes (Recommended)
- Open n8n UI
- Go to Settings ā Community Nodes
- Add in box "n8n-nodes-telegram-grampro"
- Click checkbox to allow to use external nodes.
- Click Install
- Restart n8n to load the custom node
Note: If you have trouble updating the node in the n8n UI, uninstall (remove) the GramPro node first, then perform a fresh install to resolve the issue.
Method 2: Custom Nodes Directory
- Clone to n8n custom nodes directory
- Install dependencies
npm install - Build the project
npm run build - Restart n8n to load the custom node
Method 3: GitHub Installation
- Clone from GitHub
git clone https://github.com/sadiakant/n8n-nodes-telegram-grampro.git - Move to n8n custom nodes directory
- Install dependencies
npm install - Build the project
npm run build - Restart n8n to load the custom node
āļø Quick Setup
1. Get API Credentials
- Visit my.telegram.org
- Create new application
- Note your API ID and API Hash
2. Create Session String
Use our built-in authentication operations. For detailed step-by-step instructions, see our Authorization Guide.
3. Configure Credentials
In n8n ā Settings ā Credentials:
- API ID: Your Telegram API ID
- API Hash: Your Telegram API hash
- Session String: Your encrypted session string
- Validation: Save/Test performs real MTProto getMe verification.
šÆ Comprehensive Operations Guide
For detailed documentation of all operations with parameters, examples, and use cases, see our Operations Guide.
š§ Available Operations
| Resource | Operations |
|---|---|
| Auth | Request Login Code, Resend Login Code, Sign in, Request QR Login, Complete QR Login |
| Message | Send Message, Get Chat History, Edit, Delete, Pin, Forward, Copy, Edit Media, Create Poll, Copy Restricted Content, Clear History, Unpin Message |
| Chat | Get Chat Info, Get Chats List, Join Channel/Group, Leave Channel/Group, Create Group/Channel |
| User | Get My Profile, Get Profiles Photo, Update My Profile, Update My Username, Get User Profile (Bio & Common Chats) |
| Media | Download Media Files |
| Channel | Add Member, Remove Member, Ban User, Unban User, Promote to Admin, Get Members |
š”ļø Security Features
Session Encryption
All session strings are automatically encrypted using AES-256-GCM with:
- 256-bit encryption keys derived from your API credentials
- 128-bit initialization vectors with PBKDF2 key derivation
- Authentication tags for integrity verification
- Automatic encryption/decryption transparent to users
- Secure storage prevents session exposure
Input Validation
Comprehensive validation ensures data integrity and security:
- API credentials validation (ID format, Hash length)
- Phone number format validation (international format)
- Session string validation and integrity checks
- Operation-specific parameter validation
- Real-time warnings for potential issues
Enhanced Error Handling
The node handles common Telegram errors gracefully:
- FLOOD_WAIT: Automatic retry with specified wait time
- AUTH_KEY_DUPLICATED: Clear error message about session conflicts
- SESSION_REVOKED: Guidance to re-authenticate
- USER_DEACTIVATED_BAN: Account ban detection
- PEER_FLOOD: Extended wait times for peer flooding
- NETWORK_TIMEOUT: Exponential backoff retries (up to 5 attempts)
- CHAT_WRITE_FORBIDDEN: Permission error handling
- USER_BANNED_IN_CHANNEL: Channel ban detection
- AUTH_KEY_UNREGISTERED: Session is invalid or expired and must be regenerated
- SESSION_EXPIRED: Session expired and must be renewed
- USER_PRIVACY_RESTRICTED: Action blocked by user privacy settings
- CHANNEL_PRIVATE: Channel or group is private/inaccessible
- USERNAME_NOT_OCCUPIED / USERNAME_INVALID: Username does not exist or has invalid format
- INVITE_HASH_INVALID / INVITE_HASH_EXPIRED: Invite link is invalid or expired
- PEER_ID_INVALID / MESSAGE_ID_INVALID: Chat/message identifiers are invalid
ā” Performance Optimizations
Smart Client Management
- Connection Pooling: Reuses existing TelegramClient instances via Map cache
- Race Condition Prevention: Connection locks prevent multiple simultaneous connections
- Health Monitoring: Automatic connection validation and healing
- Auto-cleanup: 30-minute stale connection detection and cleanup
- Reconnection Logic: Automatic reconnection for failed connections
- Session Encryption: Transparent AES-256-GCM session decryption
Intelligent Rate Limiting
- Configurable request intervals (minimum 1-second)
- Priority-based request queuing with queue length monitoring
- DoS protection with maximum queue size limits (1000 requests)
- Automatic cleanup of stale requests
- Enhanced Telegram API limit compliance
Smart Caching
In-memory caching for frequently accessed data:
- User information caching (5-minute TTL)
- Chat/channel metadata caching
- Dialog lists caching
- Automatic cache cleanup and size management
- Configurable cache TTL and maximum size
Memory Efficient Design
- Proper cleanup prevents memory leaks
- Connection pooling and resource management
- Background loop prevention
- Optimized data structures and algorithms
- Automatic resource cleanup
Enhanced Request Handling
- Binary File Upload: Support for text-aware send flows plus photos, videos, documents, and other file types where applicable
- Media URL Support: Direct URL upload with fallback to download-and-upload
- Progress Tracking: Real-time download progress for large media files
- Error Recovery: Automatic retry for network timeouts and connection issues
šØ Troubleshooting
For comprehensive troubleshooting guidance, common issues, and solutions, see our Troubleshooting Guide.
Project Structure
n8n-nodes-telegram-grampro/
āāā š Root Files
ā āāā .gitignore, .prettierrc.js, eslint.config.mjs
ā āāā LICENSE, README.md
ā āāā package.json, package-lock.json
ā āāā tsconfig.json
ā
āāā š .github/
ā āāā CODE_OF_CONDUCT.md, CONTRIBUTING.md, SECURITY.md
ā āāā workflows/
ā āāā build.yml
ā āāā publish.yml
ā
āāā š credentials/
ā āāā TelegramGramProApi.credentials.ts
ā āāā telegram-grampro-credentials.svg
ā
āāā š docs/
ā āāā AUTHORIZATION_GUIDE.md
ā āāā CHANGE_LOG.md
ā āāā OPERATIONS_GUIDE.md
ā āāā TROUBLESHOOTING_GUIDE.md
ā
āāā ā” nodes/
āāā š¦ TelegramGramPro/
ā āāā TelegramGramPro.node.ts
ā āāā telegram-grampro.svg
ā āāā core/
ā ā āāā cache.ts, clientManager.ts, fileSizeUtils.ts,
ā ā āāā floodWaitHandler.ts, logger.ts,
ā ā āāā messageFormatting.ts, operationHelpers.ts,
ā ā āāā payloadBuilders.ts, qrPng.ts,
ā ā āāā rateLimiter.ts, sessionEncryption.ts,
ā ā āāā telegramErrorMapper.ts, types.ts, validation.ts
ā ā
ā āāā resources/
ā āāā authentication.operations.ts
ā āāā channel.operations.ts
ā āāā chat.operations.ts
ā āāā media.operations.ts
ā āāā message.operations.ts
ā āāā user.operations.ts
ā
āāā š TelegramGramProTrigger/
āāā TelegramGramProTrigger.node.ts
āāā trigger.shared.ts
āāā telegram-grampro.svg
Workflow Examples
Ready-to-import workflow examples are available in docs/Workflows-Examples:
How to Import in n8n
- Open n8n and create a new workflow.
- Use the workflow menu and select Import from File.
- Choose one of the JSON files from
docs/Workflows-Examples/. - Re-map
telegramGramProApicredentials to your own Telegram GramPro credential. - Replace placeholders such as source/target chats, admin usernames, and sub-workflow IDs.
Advanced Configuration
Environment Variables
GRAMPRO_LOG_LEVEL=error|warn|info|debug- Control log verbosityN8N_LOG_LEVEL=error|warn|info|debug- Fallback if GRAMPRO_LOG_LEVEL not set
Performance Tuning
- Rate Limiting: Adjust intervals based on your usage patterns
- Cache Size: Configure maximum cache entries for your memory constraints
- Connection Timeout: Set appropriate timeouts for your network conditions
- Retry Attempts: Configure retry logic for your reliability requirements
Security Best Practices
- Always use encrypted session strings
- Keep API credentials secure and never expose them in workflow outputs
- Enable 2FA for your Telegram account
- Regularly rotate session strings
- Monitor logs for security events
š„ Contributors
Krushnakant Sadiya
Project Lead & Developer
We welcome contributions to make Telegram GramPro even better! For comprehensive contributions guidance, see our Contributions Guide.
ā Star History
Publishing Status
NPM Status
GitHub Status
Dependency Status
š License
MIT License - see LICENSE file for details.
š Resources
- Telegram API Documentation
- Teleproto GitHub
- n8n Custom Nodes Guide
- Telegram GramPro GitHub
- NPM Package