The OpenEvent module in DataWorks uses EventBridge to provide event message subscription and sending services. After you create a custom event bus in EventBridge, you must configure an event distribution channel in DataWorks. This enables DataWorks to publish events, which you can then manage by creating rules in EventBridge. This topic describes how to enable the event message subscription service and configure a custom event bus.
Scope
Version limit: Only DataWorks Enterprise Edition is supported.
Region limit: This feature is supported only in China (Beijing), China (Hangzhou), China (Shenzhen), China (Shanghai), China (Zhangjiakou), China (Chengdu), US (Silicon Valley), US (Virginia), Germany (Frankfurt), Japan (Tokyo), China (Hong Kong), and Singapore.
Access control: Only Open Platform Administrators, Tenant Administrators, Alibaba Cloud accounts, or RAM users with the AliyunDataWorksFullAccess permission have read and write permissions for the developer background. For more information, see Global module-level access control and Product and console access control details: RAM Policy.
Related products: OpenEvent uses EventBridge for message subscription and consumption. You must first activate EventBridge.
Precautions
If your DataWorks Enterprise Edition subscription expires, all extensions become invalid and cannot trigger event checks. Checks that have been triggered but have not reached a terminal state will automatically pass.
How it works
DataWorks exposes status change messages for core processes. In the OpenEvent module of the DataWorks Open Platform, you can map a DataWorks workspace to an EventBridge event bus. This configuration pushes all published messages from the workspace to the specified event bus. You can then manage these messages in EventBridge. For example, you can filter for messages required by a downstream system and define how and where those messages are delivered.
Messages from operations on tenant-level modules are automatically pushed to the default event bus, named Default, in EventBridge. For a list of supported tenant-level events, see Tenant-level events.
Configure in DataWorks
You must configure an event distribution channel in DataWorks to push event messages to an EventBridge event bus. Follow these steps to authorize DataWorks to access EventBridge and specify the event bus for receiving messages.
Step 1: Grant service authorization
If you are using the OpenEvent service for the first time, use your Alibaba Cloud account or a RAM user with the AliyunDataWorksFullAccess policy to authorize DataWorks to access EventBridge.
Go to the Developer Backend tab.
Log on to the DataWorks console. In the top navigation bar, select the desired region. In the left-side navigation pane, choose . On the page that appears, click Go to Open Platform. The Developer Backend tab appears.
On the Developer Backend page, click OpenEvent in the left-side navigation pane to go to the OpenEvent page.
Authorize DataWorks to access EventBridge resources.
If this is your first time using the service, an Authorize Now button appears. Follow the on-screen instructions to authorize DataWorks to access EventBridge resources. The authorization automatically creates a service-linked role named AliyunServiceRoleForDataWorksOpenPlatform. You can view this role in the Resource Access Management (RAM) console under .
Step 2: Configure an event distribution channel
An event distribution channel maps a DataWorks workspace to an EventBridge event bus, ensuring all published messages from the workspace are pushed to that specific bus.
Click Add Event Distribution Channel. In the dialog box that appears, configure the Workspace for Event Distribution and EventBridge Custom Event Bus for Distribution parameters.
If no event bus is available in EventBridge, you can click Create Custom Event Bus to go to the EventBridge console and create one. Alternatively, click Quickly Create Custom Event Bus with Same Name as Workspace to immediately generate an event bus.

Step 3: Enable the event distribution channel
After you configure the event distribution channel, you can view it on the OpenEvent page. In the Actions column, you can Delete, Enable, or Disable the channel.
Enable: After you enable the channel, event messages from the workspace are pushed to the corresponding event bus.
You can then go to the EventBridge console to view all event messages pushed from DataWorks, filter for specific messages, and define which services receive them and how.
Disable/Delete: If you disable or delete the channel, DataWorks stops pushing event messages from the workspace to the corresponding event bus. You will not be able to receive these event messages through EventBridge.
Configure in EventBridge
After you enable the event distribution channel in DataWorks, DataWorks automatically pushes published messages to the specified EventBridge event bus. You must then configure filtering in EventBridge to select which messages to consume and define how and where to deliver them.
Step 1: Create a custom event bus
If you created a custom event bus with the same name as your DataWorks workspace in Step 2: Configure an event distribution channel, you can use that bus directly. If you clicked Create Custom Event Bus, follow these steps to create one. For more information, see Event bus overview.
Log on to the EventBridge console and click Event Buses in the left-side navigation pane.
On the Event Buses page, go to the Custom Event Buses tab and click Quickly Create. The following example creates a custom event bus named
DataWorks2023. To create the bus quickly, you only need to configure the Name and Description. You can skip the Event Source, Event Rule, and Event Target steps.
Step 2: Configure an event rule
After you create the event bus, you can manually configure an event rule for it to push DataWorks event messages to the corresponding services.
In the left-side navigation pane, click Event Buses. Find the target event bus and click in the Actions column to go to the event rule configuration page.
On the Event Rules page, click Create Rule in the upper-left corner.
Configure basic information: Enter a name and description for the event rule.

Configure event pattern: An event pattern filters messages based on their content. Configure the parameters as shown in the following example:
Event Source Type: Select Custom Event Source.
Event Source: Keep the default value.
Pattern Content: Use a JSON format to specify the event message type. Each DataWorks event message has a fixed type. You can find the corresponding message type for each operation in Reference: Event list and message format and use it as the value for the
typekey in the pattern content.{ "source": [ "acs.dataworks" ], "type": [ "dataworks:InstanceStatusChanges:InstanceStatusChanges" ] }
Debug the event pattern: After you configure the event pattern, you can debug it to verify that it works as expected.
If you have already completed Step 3: Enable the event distribution channel in DataWorks, event messages are being sent to EventBridge. To test your pattern, go to the Event Tracking page, find an event from DataWorks for your bus, and copy its details. Paste the details into the Event Pattern Debugging section and click Test to verify the filter.
If the event types do not match, the message Match failed is displayed when you run a test.
When the event types match, the test displays the message Match successful, the event can be triggered normally.
Configure event targets: In addition to custom services, you can push events to a variety of other targets. For more information, see Event targets overview.
NoteThe configuration in the figure shows messages being pushed to a specified HTTPS service. If you want an extension to receive this message, select HTTPS as the service type and enter the deployment address of the extension in the URL field.
After you configure and save the event rule, EventBridge routes DataWorks event messages. This also provides support for the Extensions feature.
View pushed event messages
When the DataWorks event distribution channel is enabled and an event is triggered in DataWorks, you can view the pushed event messages on the Event Tracking page for the associated event bus. You can find different event messages based on their type. For a list of event types, see Reference: Event list and message format.

Best practices
Subscribe to messages from a local service: Best practice: Custom task deployment lockdown.