Polling or Webhook? A Decision Card for Bot Builders
Cheat sheets · 2026-11-06 · 18+ readers
Both methods deliver the same updates. The choice is about where your bot lives and who calls whom. Answer the questions below and you will know.
Five questions
- Does the bot run on a public HTTPS address? If not, polling.
- Does it run only when needed, as a function? Webhook.
- Do you need several copies for load? Webhook.
- Are you still experimenting on a laptop? Polling.
- Is inbound traffic blocked by a firewall? Polling.
At a glance
| Polling | Webhook | |
|---|---|---|
| Who starts the call | Your bot | |
| Needs public HTTPS | No | Yes |
| Idle cost | Always running | Can be zero |
| Copies at once | One | Many |
| Debugging | Simple | Needs logs |
Switching safely
- Polling to webhook: stop the poller,
setWebhook, checkgetWebhookInfo. - Webhook to polling:
deleteWebhook, then poll. - Never run both for one token.
Two rules for webhooks
Reply with a 2xx quickly, and treat repeated updates as normal. Record each update_id so that a retry does nothing twice.
Frequently asked questions
Which is faster?
Both are fast enough for chat. Your handler speed matters more.
What are the allowed webhook ports?
The documentation lists 443, 80, 88 and 8443.
How do I debug a webhook?
Use getWebhookInfo and read the last error message.