Skip to content

Telegram

The Telegram integration is built around the POST /api/integrations/telegram/webhook endpoint and the queue/runtime pipeline behind it.

Setup

  1. Provision Cloudflare resources and apply migrations.
  2. Set TELEGRAM_BOT_TOKEN on the API Worker and runtime Worker.
  3. Set TELEGRAM_WEBHOOK_SECRET on the API Worker.
  4. Seed a Telegram chat binding.
  5. Register the webhook URL with Telegram.

Recommended commands:

bash
pnpm telegram:seed:staging
pnpm telegram:webhook:staging
pnpm cf:deploy:staging

Supported commands

The bot currently recognizes:

  • /start
  • /help
  • /status
  • /run <text>

It also accepts normal text messages in the bound chat.

Reminder parsing

Plain text can become a direct reminder task or schedule.

Examples:

  • remind me in 30 minutes to stretch
  • remind me tomorrow at 9am to review runs
  • remind me next monday at 10am to check approvals
  • remind me every weekday at 8am to plan the day
  • remind me every week on friday at 5pm to send the report
  • remind me every month on 1st at 9am to reconcile usage

Runtime behavior

  • Telegram webhook payloads are normalized before they enter the queue.
  • Bound chats can create tasks, schedules, or agent-backed tasks depending on the message.
  • Quick acknowledgements are used when a response would otherwise take longer.
  • Outbound Telegram replies are logged in the messaging table.
  • Long replies are edited in place when possible and truncated to Telegram’s message limit.

Unbound chats

If Telegram sends a message from a chat that is not bound to the workspace, the webhook logs the chat as unbound and responds with a fallback message that reveals the chat id for seeding.

Cloudflare-native agent orchestration platform