Skip to main content
The Telegram Toolkit lets agents and workflows interact with Telegram bots. It supports sending and editing messages, sending media, managing chat members, generating invite links, and registering webhooks to trigger workflows from incoming messages. Telegram bots and their credentials are managed through a Telegram bot called @BotFather — there is no web developer console.

Prerequisites

Step 1 — Create a Telegram Bot

1

Open @BotFather

Open Telegram and start a conversation with @BotFather.
2

Create a new bot

Send the command /newbot and follow the prompts:
3

Copy your bot token

BotFather will reply with a success message containing your bot token — it looks like 123456789:ABCdefGhIJKlmNoPQRsTUVwxyZ. Copy and save it securely.
Set a profile picture that matches your application logo using the /setuserpic command in BotFather. A recognizable image makes your bot look professional and trustworthy to users.

Step 2 — Add the Token to EK

  1. In the workflow, add a Telegram toolkit step.
  2. Click Select a ConnectionCreate a Connection.
  3. Enter a Connection Name and paste your bot token.
  4. Click Save.

Managing Your Token

Your bot token is the master key to your bot. Do not share it, commit it to public repositories, or expose it in client-side code.
If your token is accidentally leaked, revoke it immediately:
  1. Message @BotFather
  2. Send /mybots
  3. Select your bot
  4. Tap API TokenRevoke current token
A new token will be generated. Update the connection in EK with the new value.

Available Tools

Trigger — New Message

Starts a workflow automatically whenever someone sends a message to your Telegram bot. Setup:
1

Add the trigger

Add a New Message trigger as the first step of your workflow. Copy the /tool-webhook/{workflow-id} URL from the trigger configuration panel.
2

Register the webhook

Use the Register Webhook step to tell Telegram to deliver messages to that URL. Run it once — see Register Webhook below.
3

Test

Send a test message to your bot. The workflow fires and all message data is available as variables.
Available trigger variables:

Messaging Actions

Send Text Message

Sends a text message from your bot to any Telegram chat. Key inputs: Referencing the output in downstream steps:
  • Message ID (needed for Edit or Delete later): {{ step.output.message_id }}
  • Chat ID: {{ step.output.chat_id }}

Send Media

Sends a photo, video, sticker, or animated GIF to a Telegram chat. Key inputs:
If neither Media URL nor Media ID is provided, the step returns an error. The URL must be publicly reachable — local or private URLs will not work.

Edit Message Text

Updates the text of a message previously sent by your bot. Key inputs: Example use case: Send “Processing your request…” first. Run the workflow logic. Then edit that message with the final result — the user sees one message instead of two.

Delete Message

Deletes a message from a chat. Key inputs:
Bots can only delete their own messages unless the bot is an admin in the chat. Telegram also imposes a time limit — messages older than 48 hours generally cannot be deleted by bots.

Chat & Member Actions

Get Chat Info

Retrieves metadata about a chat. Key inputs: Referencing values in downstream steps:
  • Chat title: {{ step.output.title }}
  • Description: {{ step.output.description }}
  • Invite link: {{ step.output.invite_link }}

Get Chat Member

Looks up a specific user within a chat and returns their membership status and role. Key inputs: Referencing values in downstream steps:
  • Status: {{ step.output.status }}
  • Username: {{ step.output.username }}
Possible status values: creator, administrator, member, restricted, left, kicked Example use case: Check {{ step.output.status }} — if it equals left or kicked, skip sending the message and handle the error instead. Generates a new invite link for a group or channel.
The bot must be an administrator with the “Invite Users” permission in the target chat.
Key inputs: Referencing the link in downstream steps:
  • Invite URL: {{ step.output.invite_link }}
expire_date in the output is a unix timestamp (integer seconds), not ISO format. creates_join_request will be true if the chat requires admin approval for new members.

Webhook Setup Actions

These two steps connect a New Message trigger to your bot. Run them once per workflow.

Register Webhook

Tells Telegram to start forwarding messages from your bot to your workflow URL. Key inputs:
1

Copy the trigger URL

Create a workflow with a New Message trigger. Copy the /tool-webhook/{workflow-id} URL from the trigger panel.
2

Add Register Webhook

In a separate one-time workflow or manual test run, add a Register Webhook step and fill in the inputs above.
3

Run it once

Run the step. Then send a message to your bot — your main workflow should now fire.
Alternatively, register via curl for a quick one-time setup:
A successful response:
A Telegram bot can only have one active webhook at a time. Registering a new URL replaces any previous one.

Deregister Webhook

Removes the webhook and stops Telegram from delivering messages to your workflow. Key inputs:
Deregister the webhook when you retire or archive a workflow. If you leave the webhook registered but the workflow inactive, Telegram will keep sending requests that go unanswered.

Troubleshooting