# Telegram Trigger

> Start a workflow each time your Telegram bot receives a message, and pass the text, photo, video or audio of the message to the nodes after it.

Source: https://nodaro.ai/docs/nodes/automate/telegram-trigger

The **Telegram Trigger** node starts a workflow each time your Telegram bot receives a message. It passes the text of the message, and any photo, video or audio file in it, to the nodes after it. A bot can, for example, turn every message it receives into an image. The trigger itself is free.

- Found in: Automate › Triggers
- Output: data
- API type: `telegram-trigger`

## When to use it
- Build a bot that generates an image or a video from every text message.
- Answer messages with a [Prompt](https://nodaro.ai/docs/nodes/automate/prompt) node and send the answer back with [Telegram Post](https://nodaro.ai/docs/nodes/publish/telegram-post).
- Receive the photos, videos and audio files that people send to the bot.
- Collect the posts of a group or a channel where your bot is a member, and process each one.

## Quick start
### Connect your bot

Connect your Telegram bot in **Integrations** first. See [Publishing to social](https://nodaro.ai/docs/guides/publishing-to-social).

### Add the node and choose the bot

Press Tab on the canvas and choose **Automate › Triggers › Telegram Trigger**. In the settings panel, choose the bot under **Telegram Bot**.

### Filter the messages

Optionally, enter a chat in **Chat ID Filter** and choose the **Message Types** that should start a run.

### Activate it and save

Click **Activate Trigger**, then save the workflow. The save registers the bot with Telegram, and the status reads **Active — listening for messages**.

### Send the bot a message

Every matching message now starts a run.

Workflow: Every text message to the bot becomes the prompt of Generate Image, and Telegram Post sends the image to a chat.

- Telegram Trigger → Generate Image (prompt)
- Generate Image → Telegram Post

## Settings
| Setting | What it does |
| --- | --- |
| **Telegram Bot** | The connected bot to listen on. Required: without a bot, nothing is registered. When no bot is connected yet, the panel links to **Integrations**. |
| **Chat ID Filter** | Only messages from this chat start a run, such as `@channel` or a numeric ID that starts with `-100`. Leave it empty to receive messages from every chat. |
| **Message Types** | Which kinds of messages start a run: **Text**, **Photo**, **Video**, **Audio** and **Document**. All five are on by default. |
| **Activate Trigger** | Turns the trigger on, or off with **Deactivate Trigger**. The change applies when you save the workflow. |

The status at the top of the panel shows the state of the trigger:

| Status | Meaning |
| --- | --- |
| **Active — listening for messages** | The trigger is on and a bot is chosen. |
| **Pick a bot — not listening yet** | The trigger is on, but no bot is chosen. |
| **Inactive** | The trigger is off. |

## What the node passes on

The node has one output, **Message**. When a run starts, Nodaro passes the message to the connected nodes according to what it contains:

| The message contains | It goes to |
| --- | --- |
| Text | The prompt of the next node, or the caption of a publishing node |
| A photo | An image input, such as the references of an image node |
| A video | A video input |
| Audio | An audio input |

The message also carries its chat ID and message ID. Nodaro downloads any photo, video or audio file to storage before the run starts.

## Several triggers on one bot

A Telegram bot sends its messages to exactly one address, so every trigger on the same bot shares one registration. You can point as many workflows at one bot as you want. Each incoming message is checked against the **Chat ID Filter** and **Message Types** of every trigger, and each matching trigger starts its own run.

Removing one trigger never stops the others. Deactivating or deleting a trigger removes it on the next save. When no active trigger is left on the bot, Nodaro removes the bot's registration from Telegram.

## What a triggered run executes

A trigger that is connected to nodes runs only its branch: the nodes after the trigger, and every node that they need as input. A trigger that is connected to nothing runs the whole workflow. Each Telegram Trigger that you set up in the editor runs its own branch. Two triggers on the same bot with different chat filters therefore start two separate runs for a message that matches both. A manual run from the editor, a run from the API and a run of a published app are never limited to a trigger's branch.

## Credits
The Telegram Trigger is free. Each run pays for the nodes it runs.

## Troubleshooting
- **The save warns that the trigger could not be registered.** Telegram refused the registration, and the warning says why. One usual cause is a bot token that was revoked after you connected the bot. Another is a self-hosted install whose `PUBLIC_URL` is not an HTTPS address that Telegram can reach. No trigger is created when the registration fails.
- **Nothing happens for messages in a group.** A bot receives only the group messages addressed to it, unless group privacy mode is turned off for the bot in BotFather.
- **The media is missing from the run.** Telegram lets bots download files of up to 20 MB. A larger file arrives as a message without media.

## Frequently asked questions

### How do I start a workflow from a Telegram message?

Connect your Telegram bot in Integrations, add a Telegram Trigger, choose the bot, click Activate Trigger and save the workflow. Every message that the bot receives then starts a run.

### Can several workflows listen to the same bot?

Yes. Each incoming message is checked against the filters of every trigger on that bot, and each matching trigger starts its own run. Removing one trigger never stops the others.

### Why doesn't my bot react to messages in a group?

A Telegram bot receives only the group messages that are addressed to it, unless its group privacy mode is turned off. Turn privacy mode off for the bot in BotFather.

### Can I limit the trigger to one chat?

Yes. Enter the chat in Chat ID Filter, as @channel or as a numeric ID such as -100 followed by digits. Leave it empty to receive messages from every chat.

### Does the Telegram Trigger cost credits?

No. The trigger itself is free. Each run pays for the nodes it runs.
