SlackExecution SlackExecution

yaml
type: "io.kestra.plugin.notifications.slack.SlackExecution"

Send a Slack message with the execution information

The message will include a link to the execution page in the UI along with the execution ID, namespace, flow name, the start date, duration and the final status of the execution, and (if failed) the task that led to a failure.

Use this notification task only in a flow that has a Flow trigger. Don't use this notification task in errors tasks. Instead, for errors tasks, use the SlackIncomingWebhook task.

Examples

Send a Slack notification on a failed flow execution

yaml
id: failure_alert
namespace: company.team

tasks:
  - id: send_alert
    type: io.kestra.plugin.notifications.slack.SlackExecution
    url: "{{ secret('SLACK_WEBHOOK') }}" # format: https://hooks.slack.com/services/xzy/xyz/xyz
    channel: "#general"
    executionId: "{{trigger.executionId}}"

triggers:
  - id: failed_prod_workflows
    type: io.kestra.plugin.core.trigger.Flow
    conditions:
      - type: io.kestra.plugin.core.condition.ExecutionStatusCondition
        in:
          - FAILED
          - WARNING
      - type: io.kestra.plugin.core.condition.ExecutionNamespaceCondition
        namespace: prod
        prefix: true

Send a Rocket.Chat notification on a failed flow execution

yaml
id: failure_alert
namespace: debug

tasks:
  - id: send_alert_to_rocket_chat
    type: io.kestra.plugin.notifications.slack.SlackExecution
    url: "{{ secret('ROCKET_CHAT_WEBHOOK') }}"
    channel: "#errors"
    executionId: "{{ trigger.executionId }}"
    username: "Kestra TEST"
    iconUrl: "https://avatars.githubusercontent.com/u/59033362?s=48"

triggers:
  - id: failed_prod_workflows
    type: io.kestra.plugin.core.trigger.Flow
    conditions:
      - type: io.kestra.plugin.core.condition.ExecutionStatusCondition
        in:
          - FAILED
          - WARNING
      - type: io.kestra.plugin.core.condition.ExecutionNamespaceCondition
        namespace: debug
        prefix: true

Properties

url

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️
  • Min length: 1

Slack incoming webhook URL

Check the Create an Incoming Webhook documentation for more details..

channel

  • Type: string
  • Dynamic: ✔️
  • Required:

Slack channel to send the message to

customFields

  • Type: object
  • Dynamic: ✔️
  • Required:

Custom fields to be added on notification

customMessage

  • Type: string
  • Dynamic: ✔️
  • Required:

Custom message to be added on notification

executionId

  • Type: string
  • Dynamic: ✔️
  • Required:
  • Default: {{ execution.id }}

The execution id to use

Default is the current execution, change it to {{ trigger.executionId }} if you use this task with a Flow trigger to use the original execution.

iconEmoji

  • Type: string
  • Dynamic: ✔️
  • Required:

Emoji icon to use

iconUrl

  • Type: string
  • Dynamic: ✔️
  • Required:

Url of the icon to use

options

Options

The options to set to customize the HTTP client

payload

  • Type: string
  • Dynamic: ✔️
  • Required:

Slack message payload

templateRenderMap

  • Type: object
  • Dynamic: ✔️
  • Required:

Map of variables to use for the message template

username

  • Type: string
  • Dynamic: ✔️
  • Required:

Author of the slack message

Outputs

Definitions

java.nio.charset.Charset

Properties

io.kestra.plugin.notifications.AbstractHttpOptionsTask-RequestOptions

Properties

connectTimeout
  • Type:
    • string
    • string
  • Dynamic: ✔️
  • Required:
connectionPoolIdleTimeout
  • Type:
    • string
    • string
  • Dynamic: ✔️
  • Required:
defaultCharset
  • Type:
  • Dynamic: ✔️
  • Required:
maxContentLength
  • Type:
    • integer
    • string
  • Dynamic: ✔️
  • Required:
readIdleTimeout
  • Type:
    • string
    • string
  • Dynamic: ✔️
  • Required:
readTimeout
  • Type:
    • string
    • string
  • Dynamic: ✔️
  • Required:

Was this page helpful?