Notifications

Updated at:

Use notification plugins in pipelines to send messages triggered by task running status through third-party system webhooks.

Go to the pipeline edit page and Add plugin to the desired task. The following notification plugins are supported: DingTalk robot, email, webhook, WeCom robot, and Lark robot.

Taking the DingTalk Robot notification plugin as an example, you need to configure the webhook URL, signing key, running status (for example, select Failure to trigger a notification when the task fails), and notification content.

Dingtalk robot notification

Prerequisites

  • Custom robots require security settings and must be added from a computer.

  • Create a DingTalk group and configure a Webhook robot. For more information, see Robot configuration reference.

  1. Edit the pipeline task and add the DingTalk Robot notification plug-in to the required step.

    1. In DingTalk, go to . Copy the webhook URL of the DingTalk robot and paste it into the plugin configuration.

    2. Custom DingTalk robots must have security settings enabled. If you do not use signing, you can leave the signing key field empty.

    3. Select a running status. The plugin sends a notification when the pipeline task enters the selected status.

    4. Select the notification content. The selected content is automatically added to the push message.

    5. You can enter custom content. This field supports environment variables, such as ${CI_COMMIT_TITLE}, and DingTalk Markdown syntax. For more information, see View help.

    6. You can use @phone number to mention users. Separate multiple phone numbers (numbers associated with DingTalk accounts) with a comma (,). To mention everyone in the group, enter all.

  2. Run the pipeline task. When the step reaches the configured running status, a notification is sent to the corresponding DingTalk group.

Email notification

Prerequisites

An email address that can receive messages is required.

  1. Edit the pipeline task and add the email notification plugin to the required task. In the plugin settings, enter the email address and select a running status.

    For example, if you set the running status to Failure, an email notification is triggered when the task execution fails.

  2. Run the pipeline task. When the step reaches the configured running status, a notification is sent to the specified email address.

Webhook notification

Prerequisites

The webhook URL must be publicly accessible. Verify access in a browser before configuring.

  1. Edit the pipeline task, add the webhook notification plugin to the required step, enter the webhook URL, and select a running status.

  2. When the step reaches the configured running status, a webhook call is initiated. Flow always sends a POST request. The following example shows the task status payload.

    {
      "event": "task",
      "action": "status",
      "task": {
        "pipelineId": "183",
        "pipelineName": "test pipeline",
        "stageName": "Build",
        "taskName": "java build",
        "buildNumber": "19",
        "statusCode": "SUCCESS", // UNKNOWN, RUNNING, WAITING, CANCELLING, CANCELED,FINISH,SUCCESS,FAIL,SKIP  
        "statusName": "Success",
        "pipelineUrl": "https://***.aliyun.com/ec/pipelines/1565**?build=19",
        "message": "Pipeline [test pipeline] stage [Build] task [java build] succeeded."
      },
      "sources": [
        {
          "repo": "git@gitlab:test.git",
          "branch": "master",
          "commitId": "xdfdfdff",
          "previousCommitId": "ddddd"
        }
      ],
      "globalParams": [
        {"key": "test", "value": "test1"},
        {"key": "test2", "value": "test2"}
      ]
    }

Wecom robot notification

Prerequisites

Create a WeCom group and configure a webhook robot.

After successfully adding a group robot, a dialog box displays the Webhook URL (in the format https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx). Click Copy Address to obtain the URL.

  1. Edit the pipeline task and add the WeCom robot notification plugin to the required step.

    1. In WeCom, go to . Copy the webhook URL of the WeCom robot and paste it into the plugin configuration.

    2. Select a running status. The plugin sends a notification when the pipeline task enters the selected status.

    3. Select the notification content. The selected content is automatically added to the push message.

    4. Enter custom content. Environment variables such as ${CI_COMMIT_TITLE} and DingTalk Markdown syntax are supported. View help.

    5. You can mention users by their user ID. Separate multiple user IDs (WeCom user_id) with a comma (,). To mention everyone, enter all.

      • To find a user_id, go to WeCom Admin Console > Address Book.

  2. Run the pipeline. When the task reaches the configured running status, a notification is sent to the corresponding WeCom group.

Lark robot notification

Prerequisites

Create a Lark group and configure a webhook robot. For more information, see Robot configuration reference.

After adding a custom bot in a Lark group chat, proceed to the webhook configuration step: copy the generated webhook URL (in the format https://open.feishu.cn/open-apis/bot/v2/hook/xxx), and keep the URL safe — do not publish it on GitHub, blogs, or other public websites. Configure security settings as needed. Options include Custom Keywords, IP Allowlist, and Signature Verification. Click Done when finished.

  1. Edit the pipeline task and add the Lark robot notification plugin to the required step.

    1. In Lark, go to . Copy the webhook URL of the Lark robot and paste it into the plugin configuration.

    2. If the Lark robot has "Signing" enabled, enter the signing key.

    3. Select a running status. The plugin sends a notification when the pipeline task enters the selected status.

    4. Select the notification content. The selected content is automatically added to the push message.

    5. Enter custom content. Environment variables such as ${CI_COMMIT_TITLE} are supported.

    6. You can mention users by their user ID. Separate multiple user IDs (Lark user_id) with a comma (,). To mention everyone, enter all.

      • To find a user_id, go to Lark Admin Console > Members and Departments.

  2. Run the pipeline. When the task reaches the configured running status, a notification is sent to the corresponding Lark group.