Telegram Integration

Connect your AI agents with Telegram to automate conversations and workflows directly through the popular messaging platform. The Telegram integration allows your agents to receive messages, respond intelligently, and execute actions based on user interactions.

Connect the integration

Setting up the Telegram integration with Relevance AI is straightforward:
  1. Go to the “Integrations” page in the sidebar of your Relevance AI dashboard
  2. Click on “Telegram” from the available integrations
  3. Click the “Add Integration” button
  4. You’ll be prompted to authenticate with your Telegram account
  5. Follow the on-screen instructions to authorize the connection
  6. Once connected, you’ll see your Telegram account listed under connected accounts

Setting up triggers

The Telegram integration can be configured as a trigger for your AI agents, allowing them to automatically respond when messages are received.
The Telegram Trigger is considered a Premium trigger, and is only available to Team plans and above. If you use this Trigger, you will incur an additional 5000 credits per month for each connected account in your organization.

Create a Telegram trigger

  1. Navigate to your agent’s profile page and “Triggers”
  2. Choose “Telegram” from the list of available triggers
  3. Select your connected Telegram account
  4. Configure the trigger settings:
    • Chat Type: Choose between private chats, group chats, or both
    • Message Filter: Optionally set up filters to only trigger on specific message types or content
    • Response Mode: Select whether your agent should respond automatically or require approval

Common trigger use cases

  • Customer Support: Automatically respond to customer inquiries received via Telegram
  • Lead Qualification: Trigger an agent to qualify leads that reach out through Telegram
  • Information Requests: Set up an agent to provide information when users ask specific questions
  • Appointment Scheduling: Allow users to schedule appointments through Telegram conversations
  • Order Processing: Process orders and transactions initiated through Telegram messages

Tools & Tool Steps

The Telegram integration provides several powerful actions that your agents can use as part of their workflows. These actions enable your agents to interact with Telegram in various ways.

Available Telegram actions

  • Send Message: Send a text message to a specific chat or user
  • Send Photo: Share images with optional captions
  • Send Document: Share files and documents of various formats
  • Send Location: Share geographical locations
  • Create Poll: Create and send polls to gather feedback
  • Get Chat Information: Retrieve details about a specific chat
  • Get User Profile: Retrieve information about a Telegram user
  • Pin Message: Pin important messages in a chat
  • Delete Message: Remove messages from a conversation
  • Forward Message: Forward messages between chats
  • Create Chat Invite Link: Generate invitation links for groups or channels
These are just some of the many actions available. The Telegram integration offers a comprehensive set of tools that allow your agents to leverage the full functionality of the Telegram platform.

Example workflow

Here’s an example of how you might use Telegram actions in a customer support workflow:
  1. Trigger: Agent is triggered by an incoming Telegram message
  2. Analysis: Agent analyzes the message content to determine the customer’s intent
  3. Response: Agent uses the “Send Message” action to respond with an appropriate greeting
  4. Information Gathering: If additional information is needed, agent asks follow-up questions
  5. Resolution: Once the issue is understood, agent provides a solution
  6. Documentation: Agent uses “Send Document” action to share relevant documentation if needed
  7. Follow-up: Agent schedules a follow-up message for later if the issue requires monitoring

Use the integration’s API tool step (advanced)

In addition to the pre-built actions, advanced users can access the full Telegram API for custom functionality:
  1. Create a new tool
  2. Scroll down to Tool-steps
  3. Add Telegram API tool-step
  4. Select your connected Telegram account in the dropdown
  5. Configure the API endpoint and parameters according to your needs
The Telegram API tool step gives you access to all Telegram Bot API methods, allowing for highly customized interactions beyond the standard actions.

Example API usage

{
  "method": "sendMessage",
  "chat_id": "{{chatId}}",
  "text": "This is a custom formatted message with *bold* and _italic_ text",
  "parse_mode": "Markdown"
}

Frequently asked questions (FAQs)