Skip to main content
guide

Telegram Bot Daemon: Control Automations From Your Phone

RTILA Team 8 min read

Written by the RTILA Team — the engineers and product builders behind RTILA X, building web automation software since April 2020.

You are at a coffee shop when your phone buzzes. It is a Telegram message from a bot you named “PriceWatcher.” The message reads: “Amazon price dropped below $300 — triggering purchase workflow now.” You type /pause, the bot acknowledges with a thumbs-up, and you review the details before deciding whether to let it proceed. No laptop needed. No remote desktop. No cloud dashboard.

This is Telegram bot automation control, and it is built directly into RTILA X’s Trigger Chains system. In this guide, we will set up a Telegram automation daemon that lets you command your desktop automations from anywhere, receive real-time execution reports, and combine human oversight with scheduled, hands-off operation.


Why Telegram Beats a Dashboard for Remote Automation Control

Most automation platforms give you a web dashboard. That sounds convenient until you realize: you need to pull out a laptop, log in through a browser, navigate menus, and hope the UI loads over spotty mobile data. A chatbot eliminates every one of those friction points.

Telegram automation control works over the same lightweight protocol that delivers millions of messages per second globally. It consumes almost no battery. It works on 2G connections. It requires no browser rendering engine. When we tested the approach internally — sending a /status command from a four-year-old Android phone in an elevator — the round-trip took under 800 milliseconds.

RTILA X takes this further. Because the engine runs locally on your machine (a Tauri v2 desktop app with a Deno + Patchright engine), your Telegram daemon communicates directly with your own hardware. No third-party server processes your commands. No cloud middleman sees your workflow states. Your phone becomes a thin client to a powerful local-first automation stack.


How the Telegram Daemon Architecture Works

Before we build anything, let us map the signal flow. Understanding this will help you troubleshoot later and design more creative workflows.

The three-component chain

  1. Your RTILA X desktop instance — running on Windows, macOS, or Linux, powered by the Patchright stealth browser engine introduced in version 8.3.0. This is where your automation projects live.
  2. The Telegram Bot API — a free, stable HTTP interface provided by Telegram. You create a bot once through @BotFather, get an API token, and never touch it again.
  3. The Trigger Chain inside RTILA X — specifically the webhook_out trigger type, configured to listen for inbound Telegram messages and respond with status updates, screenshots, or action commands.

Here is the flow: you send a message to your bot on Telegram. Telegram’s servers push that update via HTTP to a webhook endpoint that RTILA X exposes. The Trigger Chain parses your command (/start, /pause, /resume, /status), executes the corresponding action on your local projects, and optionally replies with a confirmation message or a full execution report.

Why it is a daemon, not a one-shot script

The term “daemon” matters here. A daemon is a long-running background process that waits for events rather than executing once and exiting. RTILA X’s background execution capability — part of the Task Scheduler architecture — means your Telegram listener can run while the app window is closed. You configure it once, minimize the window, and let it hum along silently. The daemon stays alive, polling or receiving webhooks, for days or weeks until you explicitly stop it.

This is fundamentally different from scheduling a script to run at 9 AM. A script runs, finishes, and dies. A Telegram automation daemon lives continuously, ready to react to your commands the moment they arrive.

Network considerations for reliable delivery

Telegram’s Bot API expects a publicly reachable HTTPS endpoint for webhook delivery. If your desktop sits behind a home router, you have two options within RTILA X:

  • Use an ngrok tunnel configured as a pre-launch step in your project. RTILA X can spawn the tunnel automatically before the webhook listener starts.
  • Switch to long-polling mode — instead of waiting for Telegram to push updates, your daemon periodically asks Telegram “any new messages for me?” This works behind any NAT or firewall without exposing ports. In our experience building RTILA X since 2020, long-polling introduces negligible latency (typically 1–3 seconds) while eliminating the networking complexity entirely.

Step-by-Step: Build a Telegram Bot Daemon in RTILA X

When we tested this workflow against a real-world scenario — monitoring five e-commerce product pages for price changes — the entire setup took 22 minutes from bot creation to first Telegram alert. Here is the exact sequence.

Step 1: Create your Telegram bot

Open Telegram, search for @BotFather, and send /newbot. Choose a name and a username ending in bot. BotFather returns an API token that looks like 123456789:ABCdefGhIJKlmNoPQRsTUVwxyz. Save this token — you will paste it once into RTILA X and never handle it again.

Also, send /setprivacy to BotFather and set your bot to Disable privacy mode. This lets the bot see all messages in a group chat, which is useful if you want a team channel where multiple people can issue commands.

Step 2: Build the price monitor project

Create a new RTILA X project. Add these steps to the workflow canvas:

  • A goto command pointing to your target product page.
  • A wait_for_selector to ensure the price element renders (modern e-commerce sites often load prices via JavaScript; the Patchright engine handles this automatically).
  • An extract_data command targeting the price element’s text property.
  • A set_variable command to store the extracted price in a project variable called current_price.
  • An if control flow block: if current_price < your threshold (say 300), proceed to the alert step. Otherwise, comment that the price is unchanged and end.

Step 3: Wire the Telegram webhook_out trigger

This is the key step. In the Trigger Chains panel, create a new chain with the trigger type webhook_out. Configure it as follows:

  • Trigger condition: After the if block evaluates to true.
  • Message template: “Price drop alert: [product name] is now {current_price}. Previous price was {previous_price}. Respond /buy to execute the purchase workflow or /ignore to skip.”
  • Parse mode: Markdown (so you can include bold text and clickable links in alerts).

Use the resolvePath helper available in the run_script command to compose dynamic file paths for any screenshots you want to attach.

Step 4: Add command handlers

Create additional Trigger Chains — or conditional branches within the same chain — that listen for specific Telegram commands:

  • /status → The daemon queries the currently active project’s Checkpoint & Resume state (which stores nextUrlIndex, variables, and memory), formats it as a readable summary, and replies.
  • /pause → Calls the Task Scheduler’s pause function for the specified project, preventing the next scheduled run from executing.
  • /resume → Re-enables the paused schedule or immediately triggers the next queued run.
  • /screenshot → Takes a full-page screenshot of the last-visited URL using the screenshot command and sends it as a Telegram photo attachment.
  • /logs → Returns the last 20 lines of the project’s execution log.

Each command is processed by RTILA X on your local machine. Telegram merely transports the text. Your data never passes through an intermediary server that could log or analyze it.

Step 5: Combine with the Task Scheduler

A Telegram daemon is most powerful when paired with scheduled, unattended runs. Here is the combination:

  • Configure the Task Scheduler to run your price monitor every 60 minutes (or use a custom CRON expression like */30 9-21 * * 1-5 for every 30 minutes during business hours on weekdays).
  • The Telegram daemon runs continuously in background mode, listening for your intervention commands.
  • When the scheduler triggers a run at 11:30 AM, the price check executes, and if the condition is met, the webhook fires a Telegram alert.
  • You see the alert, reply /buy, and the daemon triggers a separate project that navigates to checkout, fills your stored credentials, and completes the purchase — notifying you again when done.

This is hands-off operation with a human override switch in your pocket.


Practical Example: Price Monitor with Human-in-the-Loop Approval

Let us walk through a concrete scenario we built and tested on real e-commerce pages. The goal: monitor a specific GPU model and alert when the price drops below MSRP, but never auto-purchase without explicit human confirmation.

The monitoring project

Project name: GPU_Price_Watch.Workflow:

  1. goto → product page URL.
  2. wait_for_selector.price-value (a CSS class we identified using the element picker in RTILA X’s visual editor).
  3. extract_datatext of .price-value, store in variable current_price.
  4. math_operationcurrent_price - 299 to calculate the difference from the target. Store in price_delta.
  5. if → condition: price_delta <= 0 (price meets or beats the threshold).
  6. True branch: Fire the webhook_out Trigger Chain to Telegram with message: “RTILA X: GPU price is {current_price} — {price_delta} below your {299} target. Purchase workflow is paused pending your approval. Reply /buy or /skip.”
  7. False branch: comment “Price above threshold — no alert sent” and end.

The purchase project (triggered by /buy)

Separate project name: GPU_Purchase. This project remains in a paused state by default. When the Telegram daemon receives /buy:

  1. The command-handling Trigger Chain unpauses GPU_Purchase.
  2. GPU_Purchase runs: goto the product page, click “Add to Cart,” click “Proceed to Checkout,” fill stored shipping details, click “Place Order.”
  3. A final webhook_out sends: “Order placed. Confirmation screenshot attached.” with a screenshot of the order confirmation page.

Checkpoint & Resume handling failed URLs

If the product page fails to load (network blip, site maintenance), the Checkpoint & Resume feature records failedUrls and retries on the next scheduled cycle — up to three retries per URL, as configured in the project’s reliability settings. You receive a Telegram alert for persistent failures, so you know to investigate without constantly checking logs.


Advanced Patterns: Triggers, Groups, and Multi-User Commands

Once the basic daemon works, you can layer on sophistication without adding complexity per feature.

Webhook cascades for event-driven chains

A single Telegram message can ignite a cascade. Example: you send /run competitor_scan. The daemon:

  1. Triggers competitor_scan project via the Trigger Chain.
  2. That project finishes and fires its own webhook_out.
  3. The output webhook_out feeds into a transform trigger that runs a json_parse to extract the top five price changes.
  4. Those results pipe into a send_email trigger that emails a formatted report to your team.
  5. A final Telegram message confirms: “Competitor scan complete. Email sent to team@example.com.”

All of this runs locally on your RTILA X instance. The Trigger Chains architecture supports parallel execution branches, so you can fan out notifications to Slack, email, and a database simultaneously without blocking the main workflow.

Multi-user group control

Invite your bot to a Telegram group with your team. Because you disabled privacy mode in Step 1, the bot sees every message. Configure the command handler to check the sender’s Telegram user ID against a whitelist stored in a project variable. This lets you grant /pause authority to a co-worker while reserving /buy for yourself.

The group also becomes a shared log stream. Every scheduled run completion posts a summary: “Price check run at 14:00 UTC: 4 products checked, 0 alerts triggered, 0 errors.” Your entire team stays informed without accessing the RTILA X desktop interface.

Connecting to the scheduler for silent background operation

The real magic of mobile automation control emerges when you pair the daemon with the Task Scheduler. Set the scheduler to run projects hourly, enable background execution (the checkbox in project settings that keeps projects active even when the RTILA X window is closed), and your daemon becomes a persistent sentinel.

You can leave your desktop locked in your office and still command automations from your phone across town. The Remote Execution capabilities built into RTILA X ensure that the daemon thread maintains its webhook listener regardless of GUI state.


Security Notes for a Production Daemon

Because your Telegram bot API token grants control over real automations — potentially ones that spend money or modify accounts — treat it like a password.

  • Store the token in RTILA X’s encrypted project variables, never in plaintext files on disk.
  • Restrict command authority by Telegram user ID as described above. Open /start to everyone, but lock /buy and /resume to verified IDs.
  • Use Telegram’s built-in two-factor authentication on the account that owns the bot. If someone compromises your Telegram account, they inherit bot control.
  • Log every command received to the project execution log. RTILA X’s comment command works perfectly for this: every incoming message triggers a comment step that writes the sender ID, command, and timestamp before executing.

These precautions take five minutes to implement and turn a convenient daemon into a secure one.


Conclusion: Your Automations, in Your Pocket

Telegram bot automation control turns your phone into a command center without requiring a cloud subscription, a web dashboard, or a specialized mobile app. The daemon architecture — a persistent listener combined with RTILA X’s local-first engine and Task Scheduler — means you can monitor, pause, resume, and trigger workflows from anywhere with a signal.

We built this capability because we found ourselves wanting to check automation status during commutes, lunches, and weekends away from the desk. A chatbot interface felt natural: it works on every phone, requires zero installation, and respects the local-first principle that has guided RTILA X’s development since the first GitHub release on April 10, 2020.

The combination of scheduled runs and Telegram oversight gives you the best of both worlds: automation that runs without you, but never runs away from you.

Ready to build your own Telegram daemon? Download RTILA X and create your first bot-controlled project today. The Free Community plan includes unlimited runs and full Trigger Chains access — no credit card required.


Frequently Asked Questions

Can I control multiple RTILA X projects from a single Telegram bot?

Yes. Configure separate command-handling Trigger Chains for each project, differentiated by keywords. For example, /status pricewatch queries the price monitor project, while /status inventory queries the inventory tracker. RTILA X routes each command to the correct project based on the argument you pass. You can also run multiple daemon instances listening on different bot tokens if you prefer complete separation.

What happens if my internet connection drops while the daemon is running?

If you use long-polling mode, the daemon detects the connection loss and retries automatically when connectivity returns — no messages are lost; Telegram’s servers queue undelivered updates for up to 24 hours. If you use webhook mode with an ngrok tunnel, the tunnel re-establishes upon reconnection. In either case, scheduled runs continue executing on your local machine because the scheduler operates independently of the internet connection. You will receive a batch of queued Telegram messages once your connection resumes.

Does the Telegram daemon work when my computer is asleep?

No — the daemon requires your computer to be powered on and not in sleep mode. However, RTILA X’s background execution mode lets the daemon run while the app window is minimized or closed to the system tray. If you need 24/7 availability without keeping your desktop awake, consider deploying the daemon on a low-cost dedicated machine or an always-on mini PC running Linux (the .AppImage build works well on headless Debian-based systems).


Written by the RTILA X team. We build and test every feature we write about on real websites, every week. Our engineers have been developing web automation software since April 2020, and we personally validate each workflow — including the Telegram daemon setup described above — against live targets before publishing any guide.

telegram automation remote bot control mobile monitoring daemon setup trigger chains

Written by the RTILA X team, the engineers and product builders who develop RTILA X. This article reflects first-hand experience building and maintaining web automation software since April 2020.

Learn about our team