Hi all, I was wondering if there was any documenta...
# flyte-on-gcp
j
Hi all, I was wondering if there was any documentation or examples for setting up Slack Notifications for workflows on a GCP deployment?
d
Hey Jake To set up Slack notifications, you need to configure the notifications in your Flyte platform and then specify the notifications in your launch plan. Here's an example of how to do it: 1. Configure the notifications in your Flyte platform. This is typically done in your Helm chart configuration:
Copy code
workflow_notifications:
  enabled: true
  config:
    notifications:
      type: slack
      slack:
        url: <slack-webhook-url>
In this example, replace
<slack-webhook-url>
with your Slack Webhook URL. 2. Specify the notifications in your launch plan (example for workflow executions):
Copy code
from flytekit import Slack, WorkflowExecutionPhase, LaunchPlan, workflow, task

@task
def my_task():
    ...

@workflow
def my_workflow():
    my_task()

my_launch_plan = LaunchPlan.get_or_create(
    workflow=my_workflow,
    notifications=[
        Slack(
            phases=[WorkflowExecutionPhase.SUCCEEDED, WorkflowExecutionPhase.FAILED],
            recipients_email=["my-channel@slack.com"],
        )
    ],
)
In this example, a Slack notification will be sent to
<mailto:my-channel@slack.com|my-channel@slack.com>
when the workflow execution succeeds or fails. Please note that the
recipients_email
parameter is used to specify the Slack channel or user to send the notification to. The value should be in the format
<channel-or-user>@slack.com
.
j
thanks for the response David, I’ll give this a go today
is there any extra configuration needed if using a private channel? These are the steps I did: • created a slack app • created a webhook url for the app to the channel I want notifications in,
flyte-poc-notifications
• added the webhook url to the
values.yaml
file and ran
tf apply
• I’ve tried a launch plan using
<mailto:flyte-poc-notifications@slack.com|flyte-poc-notifications@slack.com>
,
<mailto:Jake@slack.com|Jake@slack.com>
,
<member_id>@slack.com
, as well as creating an email for the channel and trying that, but received no notification from the workflow.
d
I'll reproduce the config and will let you know