Skip to main content
Use a Custom Webhook notification block when you want to send notifications to services that do not have a dedicated Prefect block. This guide shows a Telegram example that uses the Telegram Bot API.

Telegram via Custom Webhook

Create a Custom Webhook notification block with the Telegram Bot API endpoint and payload. Example Custom Webhook configuration (UI JSON):
Notes:
  • Use the secrets field to store your bot token and chat ID, then reference them in the URL and payload.
  • parse_mode is optional; remove it if you do not want Markdown formatting.
Alternatively, create the block in Python:
Once saved, this block appears in the UI notification options. When the automation fires, Prefect populates {{ subject }} and {{ body }} with notification details.