Telegram - Setup Guide
Setup and configuration guide for Telegram integration
Telegram Bot API integration for messaging automation with Axellero.
For detailed instructions on managing credentials, connectors, and triggers in Axellero Studio, see the Integration Guide.
Step 1: Create Credential
Getting Your Bot Token
- Open Telegram and search for @BotFather
- Send
/newbotto start the creation process - Enter a name for your bot (displayed in conversations)
- Enter a username for your bot (must end with
bot, e.g.,my_awesome_bot) - Copy the Bot Token from BotFather's response
Example Token Format:
123456789:ABCdefGHIjklMNOpqrSTUvwxYZ1234567890Recommended Bot Settings in BotFather:
| Command | Purpose |
|---|---|
/setdescription | Set bot description (shown on profile) |
/setuserpic | Set bot profile picture |
/setcommands | Set command menu |
/setprivacy | Group privacy mode (disable for group bots) |
Adding Credential to Axellero
- Navigate to Application > Integrations > Credentials
- Click "Add Credential"
- Select API Key
- Enter:
- Name: "Telegram Bot - Production"
- API Key: Bot token from BotFather
- Click Save
Step 2: Create Connector
- Navigate to Application > Integrations > Connectors
- Click "Add Connector"
- Select Telegram from the list
- Configure:
- Name: "Telegram Bot - Production"
- Credential: Select the credential you created
- Click Save
- Test the connection using the "Test" button (calls getMe)
The connector is now available in any workflow or agentflow.
Step 3: Create Trigger
For supported events and payload examples, see main documentation.
3.1 Create Trigger
- Navigate to Integrations > Triggers
- Click "Add Trigger" (+) button
- Select your Telegram connector
- Configure:
- Secret Token: (Optional) Secret for webhook verification
- Events: Select update types (message, callback_query, etc.)
- Click Save
How it works: Axellero automatically generates a webhook URL and registers it with Telegram via the setWebhook API. No manual webhook setup required.
3.2 Add Trigger to Workflow
- Open Workflow Builder
- Find your trigger in the Triggers section
- Drag to canvas as starting node
- Build workflow logic after the trigger
3.3 Test the Trigger
- Send a message to your bot in Telegram
- Check workflow execution logs in Axellero
- Verify trigger data via
{{ctx.nodes.telegram_trigger.outputs.data}}
Workflow Examples
Example 1: Echo Bot
Simple bot that echoes back user messages.
Workflow Steps:
- Telegram Trigger: Events = message
- Telegram - sendMessage: Reply with received text
Configuration:
{
"chatId": "{{ctx.nodes.telegram_trigger.outputs.data.message.chat.id}}",
"text": "You said: {{ctx.nodes.telegram_trigger.outputs.data.message.text}}"
}Example 2: Interactive Button Bot
Send messages with inline keyboard buttons and handle callbacks.
Workflow Steps:
- Telegram Trigger: Events = message, callback_query
- Condition: Check if callback_query exists
- Telegram - sendMessage/answerCallbackQuery: Handle appropriately
sendMessage with Inline Keyboard:
{
"chatId": "{{ctx.nodes.telegram_trigger.outputs.data.message.chat.id}}",
"text": "Choose an option:",
"replyMarkup": {
"inline_keyboard": [
[{"text": "Option 1", "callback_data": "opt1"}, {"text": "Option 2", "callback_data": "opt2"}]
]
}
}Example 3: Notification Bot
Send alerts from external systems to Telegram channels.
Workflow Steps:
- HTTP Trigger: Receive notification from external system
- Telegram - sendMessage: Forward to Telegram channel
Configuration:
{
"chatId": "-1001234567890",
"text": "*ALERT*: {{ctx.nodes.http_trigger.outputs.data.alertName}}",
"parseMode": "MarkdownV2"
}Example 4: Support Ticket Bot
Create Linear issues from Telegram messages.
Workflow Steps:
- Telegram Trigger: Events = message
- Linear - createIssue: Create issue with message content
- Telegram - sendMessage: Send ticket confirmation
Configuration:
{
"chatId": "{{ctx.nodes.telegram_trigger.outputs.data.message.chat.id}}",
"text": "Ticket created: {{ctx.nodes.linear_create.outputs.data.identifier}}"
}Getting Chat IDs
- Private chats: User must message bot first. Use
getUpdatesto getchat.id - Groups/Channels: Add bot, send message, use
getUpdates. Group IDs are negative (e.g.,-1001234567890)
Troubleshooting
| Error | Cause | Solution |
|---|---|---|
| 401 Unauthorized | Invalid token | Verify token from BotFather |
| 400 Chat not found | Invalid chat ID | User must start conversation first |
| 403 Bot blocked | User blocked bot | Cannot send until unblocked |
| 403 Not a member | Bot not in group | Add bot to the group |
| 409 Webhook active | Conflicting methods | Use webhook OR getUpdates, not both |
| 429 Too Many Requests | Rate limited | Wait for retry_after seconds |
Common Issues
Bot can't see group messages
- Disable privacy mode: BotFather ->
/setprivacy-> "Disable" - Or make bot an administrator
Webhook not receiving updates
- Verify HTTPS URL is publicly accessible
- Check SSL certificate is valid
- Ensure no conflicting
getUpdatescalls
Media upload fails
- Max file size: 50 MB for photos/videos
- Use direct URLs, not YouTube/share links
Security Best Practices
- Store token in Axellero Credential Manager (encrypted storage)
- Use secret_token for webhook verification
- Never share bot token publicly
- Regenerate with
/revokein BotFather if compromised - Periodically review bot permissions and connected chats