Registry /
workflow / apache-airflow-providers-slack
Install & Compatibility
Where this runs
tested against v9.10.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 269MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 26.3s · import 0.000s · 269MB
268MB installed
● package 268MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SlackOperator
✓ from airflow.providers.slack.operators.slack import SlackOperator
✗ from airflow.providers.slack.operators.slack import SlackOperator
This quickstart demonstrates how to use the `SlackWebhookOperator` to send a message to a Slack channel. You need to configure an Airflow Connection named `slack_webhook_default` of type `HTTP` with your Slack Incoming Webhook URL in the 'Host' field.
from airflow.providers.slack.operators.slack_webhook import SlackWebhookOperator
from airflow.models.dag import DAG
from datetime import datetime
# IMPORTANT: For this DAG to send messages, an Airflow Connection named 'slack_webhook_default'
# must be configured. It should be an 'HTTP' connection type, with your Slack Incoming Webhook URL
# placed in the 'Host' field (e.g., https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX).
# For local testing without sending actual messages, you can create a dummy HTTP connection.
with DAG(
dag_id='slack_webhook_quickstart',
start_date=datetime(2023, 1, 1),
schedule=None, # This DAG runs manually
catchup=False,
tags=['slack', 'example'],
) as dag:
send_message_to_slack = SlackWebhookOperator(
task_id='send_message_to_slack',
slack_webhook_conn_id='slack_webhook_default',
message="Hello from Airflow! This is a test message from the quickstart DAG. :airflow:",
channel="#general" # Specify the Slack channel (optional, overrides default webhook channel)
)
airflow --version
Debug
Known issues
breakingPrior to Airflow 2.0, Slack operators and hooks were part of `airflow.contrib`. With the introduction of provider packages, all Slack-related components were moved to `airflow.providers.slack`. Importing from `airflow.contrib.operators.slack_operator` or `airflow.contrib.hooks.slack_hook` will lead to `ModuleNotFoundError` in Airflow 2.0+.fixUpdate all import statements to use the new provider path: `from airflow.providers.slack...`.
affects: Airflow 2.0+ and `apache-airflow-providers-slack` versions 1.0+
gotchaOperators like `SlackWebhookOperator` and `SlackOperator` rely on correctly configured Airflow Connections. A common mistake is using the wrong connection type (e.g., `Generic` instead of `HTTP` for webhooks, or `Generic` instead of `Slack` for the Slack API) or placing the token/URL in the wrong field (e.g., `Host` for a webhook URL, `Password` for a Slack token).fixFor `SlackWebhookOperator`, create an `HTTP` connection and place the full webhook URL in the 'Host' field. For `SlackOperator`, create a `Slack` connection and place the Slack API token (e.g., `xoxb-YOUR_TOKEN`) in the 'Password' field.
affects: All versions
gotchaWhen using `SlackOperator` (which interacts with the Slack API directly), insufficient bot token scopes (permissions) are a frequent cause of `slack_sdk.errors.SlackApiError`.fixEnsure your Slack App's bot token has the necessary OAuth scopes. For example, `chat:write` for sending messages, `files:write` for uploading files, or specific channel read/write scopes, and install the app to the relevant workspace/channels.
affects: All versions
gotcha`SlackWebhookOperator` uses Slack's incoming webhooks, which are simpler but have limitations compared to the full Slack API. It does not support features like uploading files, advanced user/channel lookups, or directly interacting with Slack APIs requiring OAuth. For these advanced use cases, `SlackOperator` (or `SlackHook` directly) should be used.fixIf advanced Slack API features are needed, switch to `SlackOperator` or interact with `SlackHook` directly. `SlackWebhookOperator` is best suited for simple message posting.
affects: All versions
breakingThe `apache-airflow-providers-slack` package, through its dependency on `slack_sdk`, uses `aiohttp` for asynchronous operations. A `ModuleNotFoundError` for `aiohttp` indicates this dependency is missing from the environment.fixInstall the `aiohttp` package: `pip install aiohttp`. If installing `apache-airflow` with extras, ensure `pip install "apache-airflow[slack]"` is used, as it should include `aiohttp` as a dependency.
affects: All versions of `apache-airflow-providers-slack` when `aiohttp` is not installed and the async client is used.
Upgrade
Version history
9.10.2latest on PyPI · released Jun 22, 2026
Audit
Dependencies
apache-airflowrequiredThis is an Airflow provider package and requires Apache Airflow to run.