For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Slack Notify step

Send a notification from a pipeline to a Slack channel.

This topic describes the settings for the Slack Notify step available in Continuous Delivery (CD) and custom stages.

The Slack Notify step lets you send notifications to a Slack channel or Slack thread during a pipeline execution.

What you will learn from this topic

  • How to add the Slack Notify step inside a container-based step group in a CD or custom stage

  • How to configure the step to send messages to a Slack channel or thread using a Slack secret key

  • How to send custom text messages or Slack Block Kit payloads from a pipeline execution

Before you begin

Before you begin, make sure you have the following:

  • A Kubernetes cluster for the container-based step group that contains the Slack Notify step.

  • A Slack secret key that you can create or select in the step.

Step-by-step guide

The step-by-step guide is available in the following tabs:

Setting up a Slack Notify step

Follow these steps to set up a Slack Notify step:

  1. Create Pipeline

    • Select Create Pipeline and enter your pipeline name.

  2. Add Stage

    • Select Add Stage. You can select any stage as this step is available across stages.

  3. Navigate to Execution Tab

    • Within the stage, go to the Execution tab.

  4. Add a Step Group

    • Add a step group.

    • Enable Container Based Execution by setting it to true.

    • Select a Kubernetes Cluster.

    • Save the step group.

  5. Add Slack Notify Step

    • Within the step group, add a step.

    • Select Slack Notify under Miscellaneous.

  6. Configure Slack Notify Step

    • Select the Channel checkbox or the Email checkbox.

    • For sending notifications to a channel, provide the channel details where you want your message to be published.

    • For sending notifications to an email address, provide the email details where you want your message to be published.

    • Optionally, send a custom text message or a Slack block.

    • Under Slack Secret Key, create or select your Slack secret key.

    • Optionally, specify the thread in which you want the notification to be received.

  7. Save and Run

    • Save your pipeline configuration and run the pipeline.

The Slack Notify step can be added in any stage, but it is only available within a step group.

Supported recipients and messages

The Slack Notify step supports the following recipient and message types.

Types of recipients supported

The following types of recipients are supported:

  • Email: The email address associated with the Slack account. This can be used to send notifications to a specific recipient.

  • Channel: The channel where the notification is to be sent. Provide the channel-id of the channel.

Types of messages supported

The following types of messages are supported:

  • Message: A plain text format. This can be a fixed value, runtime input, or an expression.

  • Block: You can send Slack Block notifications. Ensure that the block is enclosed in an array. For more information on Slack Blocks, go to the Slack documentation.

Sample block message

This block sends the notification "This is a Header block" in heading 1 format to the recipient.

Send notifications to a specific thread in a channel

To send notifications to a specific thread, provide the thread_ts details under Thread. For more information on how to get thread_ts details, see the Slack documentation.

YAML example

The following example shows the Slack Notify step in a stage.

Sample YAML describing the Slack Notify step

Upon a successful pipeline run, the message configured in the Slack Notify step is sent to the designated Slack channel or recipient.

Execution

Slack Notify step sample

Go to the Harness Community Repository for an example of how to use the Slack Notify step in Harness.

This repository provides a ready-to-use sample application and the necessary configuration files to help you get started quickly.

Next steps

Last updated

Was this helpful?