Skip to main content

Connect

Establishes a connection to Telegram using a bot token, creating a client session that can be used by other Telegram nodes.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Options

  • Bot Token - The Telegram bot token credential used to authenticate with Telegram. This token is obtained from @BotFather when you create a bot.

Output

  • Client Id - A unique identifier for the bot client connection. This ID should be passed to other Telegram nodes to use the same connection.

How It Works

The Connect node establishes a connection to Telegram's Bot API using the provided bot token. When executed, the node:

  1. Retrieves the bot token from the credential vault
  2. Validates the token format and credentials
  3. Creates a new bot client instance
  4. Generates a unique Client Id for this connection
  5. Stores the connection for use by other Telegram nodes
  6. Returns the Client Id for downstream nodes

Requirements

  • A valid Telegram bot token from @BotFather
  • The token must be stored in the Robomotion credential vault

Creating a Telegram Bot

To get a bot token:

  1. Open Telegram and search for @BotFather
  2. Start a conversation and send /newbot
  3. Choose a name for your bot (e.g., "My Automation Bot")
  4. Choose a username for your bot (must end in 'bot', e.g., "my_automation_bot")
  5. BotFather will provide your bot token (e.g., 123456789:ABCdefGHIjklMNOpqrsTUVwxyz)
  6. Save this token securely - you'll use it in the Bot Token credential field

Error Handling

The node will return errors in the following cases:

  • Invalid or empty bot token
  • Bot token not found in credential vault
  • Invalid token format
  • Network connectivity issues
  • Telegram API errors

Usage Example

Simple Bot Connection:

  1. Add a Connect node to your flow
  2. Create a new credential for your bot token
  3. Select the credential in the Bot Token field
  4. Connect the output to other Telegram nodes
  5. The Client Id will be automatically passed to connected nodes

Using Client Id:

// The Client Id is stored in the message scope
// and can be accessed by downstream nodes
{
"client_id": "abc123-def456-ghi789"
}

Best Practices

  • Store tokens securely - Always use the credential vault, never hardcode tokens
  • Reuse connections - Use one Connect node per flow and pass the Client Id to all other Telegram nodes
  • Disconnect properly - Always use a Disconnect node at the end of your flow to clean up resources
  • Test your bot - Send a test message to verify the connection works before building complex flows
  • Handle errors - Use error handling to manage connection failures gracefully

Common Use Cases

Customer Support Bot:

Connect → Receive Message → Process Query → Send Message → Disconnect

Notification System:

Trigger → Connect → Send Message → Disconnect

File Distribution:

Connect → Send Document → Send Photo → Send Message → Disconnect

Tips

  • Keep the Client Id in the message scope to share it across multiple Telegram nodes
  • The same bot token can be used in multiple flows, but each flow should have its own Connect node
  • If you change your bot token, you'll need to update the credential in the vault
  • Use the Get Bot Info node to verify your connection is working correctly