Back to Nodes

Telegram GramPro

Last updated May 28, 2026

Telegram GramPro is Advanced n8n node for Telegram MTProto automation using Teleproto (GramJS fork), featuring user account triggers and 2FA support.

375 Weekly Downloads
1,152 Monthly Downloads

Included Nodes

Telegram GramPro
Telegram GramPro Trigger

Description

!Telegram GramPro Banner

🚀 Telegram GramPro for n8n

The ultimate MTProto automation engine for n8n. Enterprise-grade security, high-performance userbot triggers, and seamless Telegram integration.

GUIDE.md”>📖 Operations Guide | GUIDE.md”>🔧 Troubleshooting | 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, Read Messages 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, Send Chat Action |
    | User | Get My Profile, Get Profiles Photo, Update My Profile, Update My Username, Update My Status, 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
  • AUTHKEYDUPLICATED: Clear error message about session conflicts
  • SESSION_REVOKED: Guidance to re-authenticate
  • USERDEACTIVATEDBAN: Account ban detection
  • PEER_FLOOD: Extended wait times for peer flooding
  • NETWORK_TIMEOUT: Exponential backoff retries (up to 5 attempts)
  • CHATWRITEFORBIDDEN: Permission error handling
  • USERBANNEDIN_CHANNEL: Channel ban detection
  • AUTHKEYUNREGISTERED: Session is invalid or expired and must be regenerated
  • SESSION_EXPIRED: Session expired and must be renewed
  • USERPRIVACYRESTRICTED: Action blocked by user privacy settings
  • CHANNEL_PRIVATE: Channel or group is private/inaccessible
  • USERNAMENOTOCCUPIED / USERNAME_INVALID: Username does not exist or has invalid format
  • INVITEHASHINVALID / INVITEHASHEXPIRED: Invite link is invalid or expired
  • PEERIDINVALID / MESSAGEIDINVALID: 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/
    │   ├── CODEOFCONDUCT.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:

  • Send messages from one user to multiple users.json
  • Send messages from folder chats to user.json
  • How to Import in n8n

    1. Open n8n and create a new workflow.
    2. Use the workflow menu and select Import from File.
    3. Choose one of the JSON files from docs/Workflows-Examples/.
    4. Re-map telegramGramProApi credentials to your own Telegram GramPro credential.
    5. Replace placeholders such as source/target chats, admin usernames, and sub-workflow IDs.

    Advanced Configuration

    Environment Variables

  • GRAMPROLOGLEVEL=error|warn|info|debug – Control log verbosity
  • N8NLOGLEVEL=error|warn|info|debug – Fallback if GRAMPROLOGLEVEL 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


    sadiakant

    Krushnakant Sadiya

    Project Lead & Developer



    We welcome contributions to make Telegram GramPro even better! For comprehensive contributions guidance, see our Contributions Guide.

    ⭐ Star History

    Star History Chart

    Publishing Status

    ![Build Status](https://github.com/sadiakant/n8n-nodes-telegram-grampro/actions/workflows/build.yml)
    ![Publish Status](https://github.com/sadiakant/n8n-nodes-telegram-grampro/actions/workflows/publish.yml)
    ![Socket Badge](https://badge.socket.dev/npm/package/n8n-nodes-telegram-grampro)
    ![GitHub Issues](https://github.com/sadiakant/n8n-nodes-telegram-grampro/issues)
    ![GitHub Pull Requests](https://github.com/sadiakant/n8n-nodes-telegram-grampro/pulls)

    NPM Status

    ![npm version](https://www.npmjs.com/package/n8n-nodes-telegram-grampro)
    ![npm downloads/week](https://www.npmjs.com/package/n8n-nodes-telegram-grampro)
    ![npm downloads/month](https://www.npmjs.com/package/n8n-nodes-telegram-grampro)
    ![npm downloads/year](https://www.npmjs.com/package/n8n-nodes-telegram-grampro)
    ![node version](https://www.npmjs.com/package/n8n-nodes-telegram-grampro)
    ![npm license](LICENSE)
    ![GitHub license](LICENSE)
    ![npm total downloads](https://www.npmjs.com/package/n8n-nodes-telegram-grampro)
    ![npm unpacked size](https://www.npmjs.com/package/n8n-nodes-telegram-grampro)
    ![npm types](https://www.npmjs.com/package/n8n-nodes-telegram-grampro)
    ![npm collaborators](https://www.npmjs.com/package/n8n-nodes-telegram-grampro)

    GitHub Status

    ![github release](https://github.com/sadiakant/n8n-nodes-telegram-grampro/releases)
    ![github stars](https://github.com/sadiakant/n8n-nodes-telegram-grampro/stargazers)
    ![github forks](https://github.com/sadiakant/n8n-nodes-telegram-grampro/network/members)
    ![last commit](https://github.com/sadiakant/n8n-nodes-telegram-grampro/commits/main)
    ![GitHub contributors](https://github.com/sadiakant/n8n-nodes-telegram-grampro/graphs/contributors)
    ![GitHub watchers](https://github.com/sadiakant/n8n-nodes-telegram-grampro/watchers)
    ![GitHub issues closed](https://github.com/sadiakant/n8n-nodes-telegram-grampro/issues)
    ![GitHub PRs closed](https://github.com/sadiakant/n8n-nodes-telegram-grampro/pulls)
    ![Commit activity](https://github.com/sadiakant/n8n-nodes-telegram-grampro/commits/main)

    Dependency Status

    ![Telegram API](https://core.telegram.org/api)
    ![TypeScript](https://www.typescriptlang.org/)
    ![n8n](https://n8n.io/)
    ![pnpm >= 9.1](https://pnpm.io/)
    ![Node >= 18.17](https://nodejs.org/)
    ![teleproto dependency](https://www.npmjs.com/package/teleproto)
    ![n8n-workflow peer dependency](https://www.npmjs.com/package/n8n-workflow)

    📄 License

    MIT License – see LICENSE file for details.

    🔗 Resources

  • Telegram API Documentation
  • Teleproto GitHub
  • n8n Custom Nodes Guide
  • Telegram GramPro GitHub
  • NPM Package
  • Built with ❤️ for n8n automation workflows