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.Step 2 — Add the Token to EK
- Workflow Builder
- Agent Builder
- In the workflow, add a Telegram toolkit step.
- Click Select a Connection → Create a Connection.
- Enter a Connection Name and paste your bot token.
- 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.
- Message @BotFather
- Send
/mybots - Select your bot
- Tap API Token → Revoke current token
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.
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 }}
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.
Create Invite Link
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.
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.
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.