{"id":2909,"library":"dagster-slack","title":"Dagster Slack","description":"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.","status":"active","version":"0.29.0","language":"en","source_language":"en","source_url":"https://github.com/dagster-io/dagster/tree/master/python_modules/libraries/dagster-slack","tags":["dagster","slack","orchestration","notifications","resource","integration"],"install":[{"cmd":"pip install dagster-slack","lang":"bash","label":"Install dagster-slack"}],"dependencies":[{"reason":"Core dependency for Dagster integrations and resources.","package":"dagster"}],"imports":[{"symbol":"SlackResource","correct":"from dagster_slack import SlackResource"},{"symbol":"make_slack_on_run_failure_sensor","correct":"from dagster_slack import make_slack_on_run_failure_sensor"},{"symbol":"make_slack_on_step_failure_hook","correct":"from dagster_slack import make_slack_on_step_failure_hook"}],"quickstart":{"code":"import os\nfrom dagster import Definitions, EnvVar, asset\nfrom dagster_slack import SlackResource\n\n@asset\ndef send_slack_message(slack: SlackResource):\n    \"\"\"An asset that sends a message to Slack.\"\"\"\n    channel = os.environ.get('SLACK_CHANNEL', '#general') # Ensure channel exists\n    slack.get_client().chat_postMessage(channel=channel, text=\":wave: Hello from Dagster!\")\n\ndefs = Definitions(\n    assets=[send_slack_message],\n    resources={\n        \"slack\": SlackResource(token=EnvVar(\"MY_SLACK_TOKEN\"))\n    },\n)\n","lang":"python","description":"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."},"warnings":[{"fix":"Always call `.get_client()` on the `SlackResource` instance before invoking Slack API methods.","message":"When interacting with the Slack client directly from the `SlackResource`, use `slack.get_client().chat_postMessage(...)` instead of `slack.chat_postMessage(...)`. The `get_client()` method ensures you are calling the method on the underlying `slack_sdk.WebClient` instance.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update `dagit_base_url` parameters to `webserver_base_url` in your sensor and hook definitions.","message":"When configuring hooks and sensors (e.g., `make_slack_on_run_failure_sensor`), the `dagit_base_url` parameter has been deprecated and replaced with `webserver_base_url` for generating deep links to runs in the UI.","severity":"breaking","affected_versions":"Dagster core 1.3.x and later, corresponding dagster-slack versions"},{"fix":"Follow the official Slack App creation and token generation guide to set up your integration.","message":"To use `dagster-slack`, you must first create a Slack App in your workspace, configure bot users, install the app to your workspace, and obtain a bot token. This token should be stored securely, ideally as an environment variable (e.g., `MY_SLACK_TOKEN`), and passed to the `SlackResource`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Migrate from `job_selection` to `monitored_jobs` in `make_slack_on_run_failure_sensor` definitions.","message":"In `make_slack_on_run_failure_sensor`, the `job_selection` and `monitor_all_repositories` parameters are deprecated. Use `monitored_jobs` for specifying jobs to monitor.","severity":"deprecated","affected_versions":"Dagster core 1.12.14 / dagster-slack 0.28.14 and later (implied)"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}