The `dagster-slack` library provides a Slack client resource for integrating Slack notifications and messaging capabilities into Dagster data pipelines. It enables users to send messages to Slack channels from ops, assets, schedules, and sensors, facilitating real-time communication about pipeline status and events. The current version is 0.29.0, and it follows the frequent release cadence of the broader Dagster ecosystem.
pip install dagster-slackVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define a `SlackResource` with a Slack bot token (loaded from an environment variable) and then use it within a Dagster asset to post a message to a specified Slack channel. A Slack App and bot token are required for this to function.
Always call `.get_client()` on the `SlackResource` instance before invoking Slack API methods.
Update `dagit_base_url` parameters to `webserver_base_url` in your sensor and hook definitions.
Follow the official Slack App creation and token generation guide to set up your integration.
Migrate from `job_selection` to `monitored_jobs` in `make_slack_on_run_failure_sensor` definitions.
Run `pip install dagster-slack` to install the library.
Ensure your Slack bot token (starts with `xoxb-`) is correct, has the `chat:write` scope (and `chat:write.public` if posting to public channels), and is passed correctly to the `SlackResource` (e.g., via `EnvVar`).
Invite your Slack bot to the desired channel by typing `/invite @your-bot-name` in the Slack channel, or add it via the channel's integration settings.
Provide the Slack token (e.g., via an environment variable) when defining your `SlackResource` in your Dagster definitions. For example: `SlackResource(token=EnvVar('SLACK_BOT_TOKEN'))`.