All Products
Search
Document Center

EventBridge:Push events to a WeCom group

Last Updated:Mar 11, 2026

EventBridge can route events from a custom event bus to a WeCom group through a webhook-based HTTP target. This guide walks you through creating a custom event bus, setting up a WeCom chatbot, configuring an event rule with a message template, and verifying end-to-end delivery.

How it works

A WeCom custom chatbot posts messages to its chat group by calling a webhook URL, without requiring approval from a tenant administrator. EventBridge delivers events to this webhook as an HTTP target, enabling change-based alerting directly in WeCom.

HTTP targets support both HTTP and HTTPS URLs accessible over the internet and within Alibaba Cloud virtual private clouds (VPCs). For details, see Route events to HTTP endpoints.

Use cases

  • Centralized event notifications: Integrate enterprise systems into WeCom through a custom chatbot so your team can monitor event information from a single chat group.

  • Lightweight alerting: Build a notification pipeline with minimal development effort. Only server-side code is needed, and all group members receive alerts automatically after integration.

Prerequisites

Before you begin, make sure that you have:

Step 1: Create a custom event bus

  1. Log on to the EventBridge console.

  2. In the left-side navigation pane, click Event Buses. Select a region in the top navigation bar, then click Quickly Create in the Custom Event Buses section.

    Custom Event Buses section with the Quickly Create button

  3. In the Create Custom Event Bus wizard, complete these steps:

    1. In the Event Bus step, enter a Name and Description, then click Next Step.

      Event Bus step showing the Name and Description fields

    2. In the Event Source step, enter an Event Source Name, set Event Provider to Custom Application, then click Next Step.

      Event Source step with Event Provider set to Custom Application

    3. In the Event Rule step, click Skip. In the Skip Subsequent Steps confirmation, click OK.

      Note

      You will create the event rule separately in Step 3.

  4. Confirm the custom event bus appears on the Event Buses page.

    Custom event bus listed on the Event Buses page

Step 2: Create a WeCom chatbot

  1. Log on to WeCom for PC and open the target WeCom group.

  2. On the Add Group Bot page, click Create a Bot.

  3. In the Create a Bot dialog box, enter a name for the chatbot, then copy the webhook URL. You will need this URL in Step 3.

Step 3: Configure an event rule

  1. Open the Overview page of the custom event bus you created and click Add Rule.

    Add Rule button on the event bus Overview page

  2. In the Create Rule wizard, complete these steps:

    1. In the Configure Basic Info step, enter a rule name and click Next Step.

      Configure Basic Info step with the rule name field

    2. In the Configure Event Pattern step, click Next Step.

      Important

      This example skips the event pattern to match all events. In production, configure the Event Source and Event Type parameters to filter events based on your requirements.

    3. In the Configure Targets step, configure the following settings:

      Parameter

      Value

      Service Type

      HTTPS

      URL

      The webhook URL you copied in Step 2

      Body

      Template

      Then configure the Variables and Template code editors:

      Variables:

      {
        "msg_source": "$.source",
        "msg_type": "$.type"
      }

      Template:

      {
        "msgtype": "text",
        "text": {
          "content": "Event source: ${msg_source}. Event Type: ${msg_type}"
        }
      }

      The variables use JSONPath expressions ($.source, $.type) to extract fields from the incoming event. The template maps these variables into a WeCom text message payload.

      Configure Targets step showing the Variables and Template editors

      Click Create.

      Note

      This example uses a minimal template. In production, customize the template to include the event fields most relevant to your team. For more template options, see Event transformation.

Step 4: Verify the result

  1. On the Overview page of the custom event bus, click Publish Event.

    Publish Event button on the event bus Overview page

  2. In the Publish Event to Custom Event Bus panel, select your custom event source from the Custom Event Source drop-down list. Enter a test event in the Event Body code editor, then click OK.

    Use the following sample event body:

    {
      "source": "my.custom.app",
      "type": "UserCreated",
      "subject": "test-event",
      "datacontenttype": "application/json",
      "data": {
        "userId": "12345",
        "action": "created"
      }
    }

    Publish Event to Custom Event Bus panel with the Event Body editor

  3. Check the WeCom group for the chatbot message. It should display the event source and event type from your test event. Based on the template above, the expected message is:

    Event source: my.custom.app. Event Type: UserCreated

What's next

  • Refine the event pattern: Add filters for specific event sources and event types to route only relevant events.

  • Customize the message template: Include additional event fields such as timestamps, resource IDs, or event details. See Event transformation.

  • Explore other HTTP targets: Route events to other webhook-based services such as DingTalk, Slack, or Feishu using the same HTTP target approach. See Route events to HTTP endpoints.