Telegram GramJS icon

Telegram GramJS

Interact with Telegram using GramJS

Actions9

Message → Send

AI-generated

Overview

This node allows sending messages via Telegram using the GramJS library. It supports sending plain text messages or messages with media attachments (such as photos or documents) to a specified chat identified by chat ID, username, or phone number.

Common scenarios where this node is beneficial include:

  • Automating notifications or alerts to Telegram chats or users.
  • Sending updates or reports from workflows directly into Telegram groups or channels.
  • Sharing files or media content programmatically through Telegram.

For example, you can use this node to send a daily summary message to a team chat or to deliver an image file as part of a workflow output.

Properties

Name Meaning
Chat ID Identifier of the chat, username, or phone number where the message will be sent.
Message Text The text content of the message to send.
Additional Options Optional settings:
• Parse Mode: How to parse the message text (None, Markdown, HTML).
• Silent: Whether to send the message silently (no notification).
Media Name of the binary property containing a media file (e.g., photo, document) to attach to the message. Optional.

Output

The node outputs JSON data representing the result of the send operation. Specifically:

  • When sending a message without media, the output JSON contains details about the sent message returned by the Telegram API.
  • When sending a message with media, the output JSON similarly contains the message details including the attached media information.

The output does not include binary data for the media itself; media must be provided as input in a binary property.

Dependencies

  • Requires a valid Telegram API authentication setup using credentials that provide:
    • API ID
    • API Hash
    • Session string (for authentication)
    • Phone number (used only if session string is not provided, but password and phone code authentication are not supported in this node)
  • Uses the GramJS Telegram client library internally.
  • No additional environment variables are required beyond the Telegram API credentials.

Troubleshooting

  • Authentication errors: If the node throws an authentication error, ensure that the session string credential is correctly set up. Password and phone code authentication are not supported in this node.
  • Missing media file: If you specify a media property name but the corresponding binary data is missing or empty, the node will fallback to sending a text message only.
  • Invalid chat ID: Providing an incorrect or invalid chat identifier may cause the Telegram API to reject the request.
  • Parse mode issues: Using unsupported parse modes or malformed markdown/html in the message text may cause message sending to fail.
  • Silent option: If the silent flag is set, the message will be sent without notifying the chat members.

Links and References

Discussion