Module Contents

class airflow.contrib.operators.discord_webhook_operator.DiscordWebhookOperator(http_conn_id=None, webhook_endpoint=None, message='', username=None, avatar_url=None, tts=False, proxy=None, *args, **kwargs)[source]


This operator allows you to post messages to Discord using incoming webhooks. Takes a Discord connection ID with a default relative webhook endpoint. The default endpoint can be overridden using the webhook_endpoint parameter (

Each Discord webhook can be pre-configured to use a specific username and avatar_url. You can override these defaults in this operator.

  • http_conn_id (str) – Http connection ID with host as “” and default webhook endpoint in the extra field in the form of {“webhook_endpoint”: “webhooks/{}/{webhook.token}”}

  • webhook_endpoint (str) – Discord webhook endpoint in the form of “webhooks/{}/{webhook.token}”

  • message (str) – The message you want to send to your Discord channel (max 2000 characters). (templated)

  • username (str) – Override the default username of the webhook. (templated)

  • avatar_url (str) – Override the default avatar of the webhook

  • tts (bool) – Is a text-to-speech message

  • proxy (str) – Proxy to use to make the Discord webhook call

template_fields = ['username', 'message'][source]
execute(self, context)[source]

Call the DiscordWebhookHook to post message