Push alerts to a WeCom group via the group's custom robot (Webhook). Beginners can finish the setup step by step.

Overview

The WeCom group robot notification channel pushes alert events from Nightingale to a designated WeCom group via the WeCom group custom robot (Webhook). Messages are delivered as Markdown text.

  • Use case: deliver alerts into a WeCom group so the team can respond in the chat.
  • Prerequisites: a WeCom group, plus permission to “Add Group Robot” in that group.
  • The whole setup has three steps: ① Add a group robot in the WeCom group → ② Create a WeCom notification channel in Nightingale → ③ Fill in the Key in the notification rule.

If you want to deliver alerts via WeCom application messages (e.g. into a single chat with an individual, @ specific members by userid) and support image-card messages, see the WeCom Application doc. This page only covers the most common and simplest group-robot approach.

Step 1: Add a group robot in the WeCom group

  1. Open the target WeCom group, top right Group Settings → Group Robots → Add Robot → New Robot.

  2. Enter the robot name (for example Nightingale Alert) and avatar, then click “Add”.

  3. After creation, copy the Webhook URL from the robot management popup. It looks like:

    https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    

    The string after ?key= is the Key (actually a UUID) you’ll fill into Nightingale later — save it.

Official WeCom limit: a single robot can send at most 20 messages per minute, exceeding which triggers throttling. For very high alert volumes, split alerts across multiple groups/robots, or enable alert suppression in your notification rule.

Step 2: Create a WeCom notification channel in Nightingale

  1. Sign in to Nightingale → left menu Notification → Notification Channels.

  2. In the channel-type panel on the left, click WeCom to enter the create page (URL /notification-channels/add?ident=wecom).

    Notification channel entrance

  3. Fill in the basics and save. Most fields are pre-filled by the system — you only need to change “Name”:

    WeCom notification channel form

    Section Field Edit needed Notes
    Basic Name Yes e.g. WeCom Group Robot. This is what appears when you select the channel in a notification rule
    Basic Enabled Keep on If turned off, the channel will not be used
    Variables Contact Method Optional The WeCom group-robot webhook does not support @ via the atMobiles parameter, so this can be left blank
    Variables Parameters Keep default, do not delete The parameters key and bot_name are pre-set; the actual key is filled in step 3 inside the notification rule
    HTTP URL Keep default https://qyapi.weixin.qq.com/cgi-bin/webhook/send
    HTTP Method POST WeCom Webhook only accepts POST
    HTTP Headers Content-Type: application/json Pre-filled
  4. Scrolling down you will see “Request Parameters” and “Request Body”. These two pieces are the core sending logic for WeCom — keep them as default:

    HTTP config and request body

    • Request Parameters has key = {{$params.key}} pre-set, meaning the real key comes from the key parameter filled in the notification rule;

    • Request Body is pre-set to WeCom Markdown message format:

      {
        "msgtype": "markdown",
        "markdown": {
          "content": "{{$tpl.content}}"
        }
      }
      

      Where {{$tpl.content}} comes from the message template named Wecom (built-in; includes alert severity, rule name, trigger value, tags, time and so on).

  5. Click Save in the lower-left, and a notification channel of type “WeCom” is ready.

Note: Nightingale v8 no longer stores the key on the channel itself like older versions did. The same WeCom channel can be reused across multiple groups/robots; each notification rule fills in its own key.

Step 3: Fill in the Key in the notification rule

The UUID after ?key= in the WeCom robot Webhook URL is filled inside the notification rule:

  1. Left menu Notification → Notification Rules → New (or edit an existing rule).

  2. In the “Notification Configuration” area:

    • Notification Channel: pick the WeCom channel you just created;
    • Message Template: pick Wecom (built-in; if missing, import the default templates from “Message Templates”);
    • Key: paste the Key from Step 1 (just the UUID after key=, no full URL);
    • Bot Name: optional; a name to help you identify it, such as Nightingale Monitoring;
    • Applicable Severity / Time Range / Tags: filter which events to push as needed.
  3. After saving, click “Notification Test” to send a test message — the WeCom group should immediately receive a Markdown alert.

One WeCom channel + multiple robots

If different business lines want to push to different groups, no new channel is needed — just create another notification rule with a different key.

Advanced: send alert screenshots

The default request body sends only text messages. To push the alert chart screenshot together to the WeCom group, you can append an image message block below the default request body. WeCom robots support msgtype: image, but you must first configure the App credentials in the channel’s “Advanced Settings” so Nightingale can automatically upload the image and obtain a media_id at send time. There are quite a few steps; beginners are not advised to enable this on the first setup. Once you are familiar with the basic group robot, refer to WeCom · Group Robot Configuration and extend it yourself.

FAQ

Q1: Getting invalid webhook url?

A: The Key filled into the notification rule has the wrong format. You should fill only the UUID after ?key=, without the https://...?key= prefix.

Q2: Getting "errcode":93000 / "errmsg":"invalid bot"?

A: The Key is wrong, or the corresponding robot has been removed from the group. Go back to the WeCom group → Group Settings → Group Robots, re-open that robot and confirm the Webhook URL.

Q3: Hitting rate limits (returns "errcode":45009 / too many requests)?

A: WeCom officially caps a single robot at 20 messages/minute. Recommendations:

  • Enable alert suppression / aggregation;
  • Split traffic across multiple groups by business;
  • Send only P1/P2 alerts to WeCom, route P3 to email or another async channel.

Q4: Messages arrive without any formatting, just a big chunk of raw JSON?

A: The msgtype in the request body must be markdown, and the JSON must be valid. If you have modified the request body, validate it against the WeCom markdown message format and use a JSON formatter to confirm there are no syntax errors before saving.

Q5: Can I just put the full URL into the request body?

A: Yes. The system is compatible with both forms — if the value starts with http:// or https://, it is treated as a complete Webhook URL and sent as-is; otherwise it is concatenated as https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=<your value>.

Q6: Does it support @ specific members?

A: WeCom group robot webhooks do not support @ by phone number via the atMobiles parameter the way DingTalk does — you can only manually embed <@userid> in the markdown content using the WeCom member userid, which is relatively cumbersome. If @-mentions are required, switch to WeCom application messages.

References

快猫星云 联系方式 快猫星云 联系方式
快猫星云 联系方式
快猫星云 联系方式
快猫星云 联系方式
快猫星云