Telegram Long Polling Trigger icon

Telegram Long Polling Trigger

Long polling daemon for many Telegram bots. Each bot runs its own continuous getUpdates loop and emits events to n8n immediately. Errors (e.g. 401/403) go to the second output (Error).

Telegram Long Polling Trigger

AI-generated

Summary

Polls Telegram continuously for updates from bots registered as active in Redis, emitting each update on the main output and polling errors on the Error output. Requires Redis credentials; in manual workflow runs, checks active bots once and emits the first update or error received.

Inputs

  • Supervisor Interval (seconds) — How often the active bot list is reconciled from Redis (default 5 seconds); does not change each bot’s polling frequency.
  • Poll Timeout (seconds) — Long-poll timeout for each bot’s getUpdates request (default 25 seconds, capped at 30).
  • Redis credentials (required) — Connects to Redis, which supplies the queued and active bot records and stores each bot’s update offset.

Output shape

Two outputs: Output emits one item per Telegram update; Error emits polling errors.

Update items contain botId, the bot record, eventType, a flattened parsed object, and the raw Telegram update. Error items contain botId, error text, and selected bot details. In active mode the trigger continuously polls; in manual mode it makes a single polling attempt across active bots and finishes after the first update or error, or a timeout. A 401 error temporarily disables polling for that bot for 20 minutes.

Links

Discussion