telegram-grammy-stage

n8n nodes for Telegram via Grammy: orchestrator (Strapi + Redis), long polling trigger (400+ bots), and API operations (Message, Chat, File)

Package Information

Released: 4 mo ago
Downloads: 27 weekly / 77 monthly
Latest Version: 0.4.12-stage.4
Author: n8n-community

Available Nodes

DocumentationAI-generated

n8n-nodes-telegram-grammy-stage

Overview

This package provides n8n nodes for building scalable Telegram bot workflows using the Grammy library. It integrates with Telegram via Grammy to handle messaging, file management, and chat operations, and includes orchestration components that connect to Strapi and Redis to manage multiple bots and long‑polling triggers. The package is designed for teams operating many bots, supporting automated message sending, campaign management, user tracking, and error handling within a single workflow.

Nodes & Operations

Telegram Orchestrator (Stage)

Reconciles a list of Telegram bots stored in Strapi with their active polling status in Redis, enqueuing bots that need to be started or restarted in the long‑polling daemon.

  • Default · Default — Orchestrates Telegram bots by reconciling the Strapi bot list with Redis poll status and enqueuing missing or inactive bots.

Telegram Long Polling Trigger (Stage)

Runs a long‑polling daemon for multiple Telegram bots, reading the bot list from Redis and emitting update items on the main output while routing errors to a separate error output.

  • Default · Default — Starts a long‑polling daemon for multiple Telegram bots, reading bot list from Redis and emitting update items on the main output while sending errors to the error output.

Telegram (Grammy) [Stage]

Sends and manages Telegram messages, chats, and files using the Grammy library, providing operations for sending, editing, deleting, forwarding, and retrieving chat details and files.

  • Message · Send — Send a Telegram message of selected type (text, single media, or media group) using a bot token
  • Message · Edit — Edit a previously sent Telegram message by updating its text and optionally reply markup or entities.
  • Message · Delete — Delete a Telegram message
  • Message · Forward — Forward a Telegram message from a source chat to a target chat
  • Chat · Get — Get chat details
  • Chat · Get Admins — Retrieves the list of chat administrators.
  • Chat · Leave — Leave a Telegram chat
  • Chat · Get Member — Retrieves a specific chat member by user ID
  • File · Get — Fetch a Telegram file by its file_id and return its metadata
  • File · Get File Path — Retrieve the Telegram file path for a given file ID.

Telegram Approve Channel Join (Stage)

Handles Telegram channel join requests, allowing bots to approve or decline user entry into a chat.

  • Default · Default — Approve or decline a channel join request for a Telegram bot

HTML to Telegram Entities (Stage)

Converts HTML markup into plain text and a Telegram MessageEntity array, preparing content for use in Telegram message or caption operations.

  • Default · Default — Convert HTML to Telegram plain text and MessageEntity list, optionally merging or replacing the item

Telegram Message Type (Stage)

Detects the type of a Telegram message (media, buttons, content) and outputs normalized parameters for use with multi‑action sending nodes.

  • Default · Default — Detect Telegram message type and output normalized send parameters for Telegram Multi Actions.

Strapi Bot Lookup (Stage)

Fetches a single bot or lists/searches bots from Strapi with support for filtering, pagination, sorting, and field selection.

  • Default · Get by ID — Fetch a single bot by ID from Strapi, optionally populating related resources and handling not‑found cases gracefully.
  • Default · List / Search — List or search bots in a Strapi collection using filters, pagination, sorting, and field selection.

Filter to SQL (Stage)

Transforms a JSON array of filter conditions into a ready‑to‑use SQL WHERE clause string for direct inclusion in queries.

  • Default · Default — Transforms a JSON array of filter conditions into a ready‑to‑use SQL WHERE clause.

Add Minutes to ISO Time (Stage)

Adds a specified number of minutes to an ISO‑8601 datetime and returns the adjusted time in both ISO and timestamp formats.

  • Default · Default — Add minutes to an ISO‑formatted datetime and return the adjusted time.

Error to Slack (Stage)

Sends error notifications from the Telegram Long Polling Trigger (or any node outputting botId and error) to a configured Slack channel.

  • Default · Default — Send error notifications to Slack using a configurable bot token, channel, and formatting options.

Campaign Select Message (Stage)

Retrieves a template message from the campaign API based on language, bot ID, and cursor, returning packed content including media and buttons.

  • Default · Default — Selects a template message from the campaign API based on language, bot ID, cursor, and welcome flag.

Campaigns By Time (Stage)

Fetches campaigns filtered by a daily time window using the Campaign API endpoint /api/campaigns/by-time.

  • Default · Default — Retrieve campaigns filtered by a daily time window

Campaigns By Bot (Stage)

Retrieves campaigns for a specific Telegram bot via the Campaigns By Bot API endpoint.

  • Default · Default — Fetch campaigns for a Telegram bot via the Campaigns By Bot API.

Strapi Push Planner Ready Schedules (Stage)

Fetches a list of push‑planner schedules that are ready for delivery within a given UTC datetime and backward minute window.

  • Default · Default — Fetch Strapi push‑planner ready‑schedules for a given UTC datetime and backward minute window.

ContentRunner User Upsert (Stage)

Inserts or updates a user record in n8n_content_runner using the Telegram chat ID, optionally notifying Customer.io.

  • Default · Default — Upserts Telegram user data in PostgreSQL, optionally notifying Customer.io, returning inserted/updated rows.

ContentRunner Bot Upsert (Stage)

Inserts or updates a bot record in n8n_content_runner using the bot ID.

  • Default · Default — Upsert Telegram bots in n8n_content_runner by tg_bot_id

ContentRunner Campaign Upsert (Stage)

Upserts a campaign record linked to a user‑bot pair in n8n_content_runner, populating fields from Strapi.

  • Default · Default — Upsert a Strapi campaign linked to a user+bot pair by querying user_bot_interactions and updating campaign fields.

ContentRunner Interaction (Stage)

Manages user‑bot interactions by linking users to bots, retrieving interaction states, or updating state fields.

  • Default · Link — Link a Telegram user to a bot, upserting user, bot, channel and creating an empty campaign record.
  • Default · Get State — Retrieve interaction state for a user‑bot linkage, optionally filtered by campaign.
  • Default · Update State — Update an existing ContentRunner interaction state with cursor and timing fields identified by Telegram chat+bot or by user+bot UUID.

ContentRunner Get State (Stage)

Fetches the interaction state for a user‑bot pair using either Telegram IDs or user and bot UUIDs.

  • Default · Default — Fetch interaction state by user‑bot identifier, returning match info or a not‑found flag.

ContentRunner Set Blocked (Stage)

Updates only the blocked_at timestamp for a user‑bot interaction.

  • Default · Default — Update blocked_at for a user‑bot interaction identified by telegram chat and bot IDs or by user and bot IDs

ContentRunner Bot Set Active (Stage)

Sets the is_active flag for a bot identified by its ID.

  • Default · Default — Sets the is_active flag of a Telegram bot identified by tgBotId

ContentRunner Next Message (Stage)

Computes the next message for a user based on their current state and branch configuration, including timing and end‑of‑branch indicators.

  • Default · Default — Computes per‑branch state, next and after‑next messages, and passes through selected input fields.

Strapi Push Planner Delivery Callback (Stage)

Sends delivery status callbacks for scheduled messages back to the Strapi push‑planner API.

  • Default · Default — Sends a delivery status callback to Strapi’s push‑planner API.

Telegram Multi Actions (Stage)

Sends a wide variety of Telegram content types including text, media, polls, and locations via Grammy, with optional rate limiting and separate error handling for blocked users.

  • Default · Send Text — Send a text message to a Telegram chat using provided token and optional reply markup and entities
  • Default · Send Photo — Send a Telegram photo using the specified operation parameters.
  • Default · Send Video — Send a video to a specified chat, optionally uploading binary data or using a URL/file_id, with caption, markup, reply-to, and rate-limit controls.
  • Default · Send Video Note — Send a video note to a Telegram chat
  • Default · Send Audio — Send an audio message to a Telegram chat using a bot token.
  • Default · Send Voice
  • Default · Send Document
  • Default · Send Animation
  • Default · Send Sticker
  • Default · Send Media Group
  • Default · Forward Message
  • Default · Copy Message
  • Default · Send Location
  • Default · Send Venue
  • Default · Send Contact
  • Default · Send Poll
  • Default · Send Dice

ContentRunner Channel Upsert (Stage)

Inserts or updates a channel or chat record in n8n_content_runner using the Telegram chat ID.

  • Default · Default

Installation

Install as an n8n community node: in n8n, open Settings → Community nodes → Install and enter n8n-nodes-telegram-grammy-stage.

Links

Discussion