Skip to main content

prefect-slack

Welcome!

prefect-slack is a collection of prebuilt Prefect tasks and blocks that can be used to quickly send Slack messages in your Prefect flows.

Getting Started

Python setup

Requires an installation of Python 3.10+

We recommend using a Python virtual environment manager such as uv, pipenv, conda, or virtualenv.

These tasks are designed to work with Prefect 3.x. For more information about how to use Prefect, please refer to the Prefect documentation.

Installation

Install prefect-slack

pip install prefect-slack

Slack setup

In order to use tasks in the collection, you'll first need to create an Slack app and install it in your Slack workspace. You can create a Slack app by navigating to the apps page for your Slack account and selecting 'Create New App'.

For tasks that require a Bot user OAuth token, you can get a token for your app by navigating to your apps OAuth & Permissions page.

For tasks that require and Webhook URL, you get generate new Webhook URLs by navigating to you apps Incoming Webhooks page.

Slack's Basic app setup guide provides additional details on setting up a Slack app.

Write and run a flow

from prefect import flow
from prefect.context import get_run_context
from prefect_slack import SlackCredentials
from prefect_slack.messages import send_chat_message


@flow
def example_send_message_flow():
   context = get_run_context()

   # Run other tasks and subflows here

   token = "xoxb-your-bot-token-here"
   send_chat_message(
         slack_credentials=SlackCredentials(token),
         channel="#prefect",
         text=f"Flow run {context.flow_run.name} completed :tada:"
   )

example_send_message_flow()

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prefect_slack-0.4.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prefect_slack-0.4.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file prefect_slack-0.4.0.tar.gz.

File metadata

  • Download URL: prefect_slack-0.4.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for prefect_slack-0.4.0.tar.gz
Algorithm Hash digest
SHA256 a49303796602b8d8df674f69446809ef1ad820c631a8ebeadf136180c638e54c
MD5 d6528760dc7045a65b1291c4348314ef
BLAKE2b-256 3bcb9ce2d4a4e0732e91bdc6bc9c1e81239d2cb68ebfefe51fd77b054a7a49b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for prefect_slack-0.4.0.tar.gz:

Publisher: integration-package-release.yaml on PrefectHQ/prefect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file prefect_slack-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: prefect_slack-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for prefect_slack-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e91c31eeb4f202413d21509bab8502999400e4f7a374fe67022a0050ab4838c4
MD5 be081b652a410a85c0868123c8d6adee
BLAKE2b-256 2287f57aa0df3be1a4f83d1178331bf53b7959637b07e16a7707e995a25e5533

See more details on using hashes here.

Provenance

The following attestation bundles were made for prefect_slack-0.4.0-py3-none-any.whl:

Publisher: integration-package-release.yaml on PrefectHQ/prefect

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page