Airflow Summit 2025 is coming October 07-09. Register now for early bird ticket!

airflow.providers.slack.notifications.slack

Attributes

ICON_URL

send_slack_notification

Classes

SlackNotifier

Slack BaseNotifier.

Module Contents

airflow.providers.slack.notifications.slack.ICON_URL: str = 'https://raw.githubusercontent.com/apache/airflow/main/airflow-core/src/airflow/ui/public/pin_100.png'[source]
class airflow.providers.slack.notifications.slack.SlackNotifier(*, slack_conn_id=SlackHook.default_conn_name, text='This is a default message', channel='#general', username='Airflow', icon_url=ICON_URL, attachments=(), blocks=(), base_url=None, proxy=None, timeout=None, retry_handlers=None, unfurl_links=True, unfurl_media=True)[source]

Bases: airflow.providers.common.compat.notifier.BaseNotifier

Slack BaseNotifier.

Parameters:
  • slack_conn_id (str) – Slack API token (https://api.slack.com/web).

  • text (str) – The content of the message

  • channel (str) – The channel to send the message to. Optional

  • username (str) – The username to send the message as. Optional

  • icon_url (str) – The icon to use for the message. Optional

  • blocks (collections.abc.Sequence) – A list of blocks to send with the message. Optional

  • timeout (int | None) – The maximum number of seconds the client will wait to connect and receive a response from Slack. Optional

  • base_url (str | None) – A string representing the Slack API base URL. Optional

  • proxy (str | None) – Proxy to make the Slack API call. Optional

  • retry_handlers (list[slack_sdk.http_retry.RetryHandler] | None) – List of handlers to customize retry logic in slack_sdk.WebClient. Optional

  • attachments (collections.abc.Sequence) – (legacy) A list of attachments to send with the message. Optional

  • unfurl_links (bool) – Option to indicate whether text url should unfurl. Optional

  • unfurl_media (bool) – Option to indicate whether media url should unfurl. Optional

template_fields = ('text', 'channel', 'username', 'attachments', 'blocks')[source]
slack_conn_id = 'slack_api_default'[source]
text = 'This is a default message'[source]
channel = '#general'[source]
username = 'Airflow'[source]
icon_url = 'https://raw.githubusercontent.com/apache/airflow/main/airflow-core/src/airflow/ui/public/pin_100.png'[source]
attachments = ()[source]
blocks = ()[source]
base_url = None[source]
timeout = None[source]
proxy = None[source]
retry_handlers = None[source]
unfurl_media = True[source]
property hook: airflow.providers.slack.hooks.slack.SlackHook[source]

Slack Hook.

notify(context)[source]

Send a message to a Slack Channel.

airflow.providers.slack.notifications.slack.send_slack_notification[source]

Was this entry helpful?