Registry / workflow / apache-airflow-providers-slack

apache-airflow-providers-slack

JSON →
library9.10.2pypypi✓ verified 26d ago

The Apache Airflow Slack provider package enables interaction with Slack, offering operators and hooks to send messages, upload files, and integrate with Slack workflows. It includes `SlackOperator` for the Slack API and `SlackWebhookOperator` for incoming webhooks. The current version is 9.9.0, and provider packages typically release independently of core Airflow, often aligning with Airflow's major releases or critical bug fixes.

pip install apache-airflow-providers-slack
INSTALL
IMPORT
SIG · APACHE-AIRFLOW-PRO
A
apache-airflow-providers-slack
workflowpythonv9.10.2
Install
26.3s avg
Import
Disk
268MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 269MB
glibc
py 3.103.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+.
fix
Update 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).
fix
For `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`.
fix
Ensure 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.
fix
If 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.
fix
Install 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.
Agent activity
51 hits · last 30 days
node
38
OpenAI (training)
2
Perplexity
1
Resources