This topic describes the structure of an OpenEvent message in DataWorks. It provides examples to show you the body of OpenEvent messages for different types of events and describes the involved fields. Information in this topic helps you understand an OpenEvent message and learn details of the status changes in DataWorks at the earliest opportunity.

Message structure

The following sample code provides an example of a complete OpenEvent message:
{ 
  "messageBody": OBJECT,
  "messageId": "d62427a0-eb1d-4ec6-926e-8665068f7cbc",
  "eventType":"commit-file",
  "eventCategoryType":"file-change",
  "blockBusiness":true
}
The following table describes the fields in the preceding sample code.
Field Type Description
messageBody Object The body of the message. For more information about the message body for different types of events, see the following sections of this topic:
messageId Text The unique ID of the message.
eventType Text

The type of the event. Valid values include commit-file and deploy-file. For more information, see the Valid values of eventType section of this topic.

eventCategoryType Text The category to which the event type belongs. Valid values include instance-status-change and file-change. For more information, see the Valid values of eventCategoryType section of this topic.
blockBusiness Boolean Indicates whether workflows are blocked.
  • If the value is true, the message is an extension point message and workflows are blocked. After an extension point message is received, you can use an extension to check the related extension point event and call an API operation to send the check results to DataWorks.
  • If the value is false, the message is a regular message and workflows are not blocked.

Message body for an instance status change event

Sample code:
 {
        "finishTime": 1619148187000,
        "beginWaitTimeTime": 1619148161000,
        "beginRunningTime": 1619148163000,
        "dagId": *****,
        "dagType": 0,
        "taskType": 0,
        "modifyTime": 1619148187000,
        "createTime": 1619027108000,
        "appId": *****,
        "tenantId": *****,
        "opCode": 61,
        "flowId": *****,
        "nodeId": *****,
        "beginWaitResTime": 1619148161000,
        "taskId": *****,
        "status": 6
    }
Field Type Description
finishTime Long The time when the auto triggered node instance stopped running.
beginWaitTimeTime Long The time when the auto triggered node instance started to wait for the scheduled time.
beginRunningTime Long The time when the auto triggered node instance started to run.
dagId Long The ID of the directed acyclic graph (DAG).
dagType Integer
The type of the DAG. Valid values:
  • 0: for auto triggered nodes
  • 1: for manually triggered nodes
  • 2: for smoke testing
  • 3: for data backfill nodes
  • 4: for manually triggered workflows
  • 5: for temporary workflows
taskType Integer
The type of the node. Valid values:
  • NORMAL(0): The node is an auto triggered node. The node is regularly run.
  • MANUAL(1): The node is a manually triggered node. The node is not regularly run.
  • PAUSE(2): The node is a frozen node. The scheduling system still regularly runs the node but sets the node status to Failed when the scheduling system starts to run the node.
  • SKIP(3): The node is a dry-run node. The scheduling system still regularly runs the node but sets the node status to Succeeded when the scheduling system starts to run the node.
  • SKIP_UNCHOOSE(4): The node is an unselected node in a temporary workflow. This type of node exists only in temporary workflows. The scheduling system sets the node status to Succeeded when the scheduling system starts to run the node.
  • SKIP_CYCLE(5): The node is a node that is scheduled by the week or month and is waiting for the scheduled time to arrive. The scheduling system still regularly runs the node but sets the node status to Succeeded when the scheduling system starts to run the node.
  • CONDITION_UNCHOOSE(6): The node is not selected by an ancestor branch node and is dry run.
  • REALTIME_DEPRECATED(7): The node has instances that are generated in real time but deprecated. The scheduling system sets the node status to Succeeded.
modifyTime Long The time when the node was modified.
createTime Long The time when the node was created.
appId Long The ID of the workspace.
tenantId Long The ID of the tenant to which the auto triggered node instance belongs.
opCode Integer The operation code of the auto triggered node instance. You can ignore this field.
flowId Long The ID of the workflow. For an auto triggered node instance, the field value is 1. For a manually triggered workflow or an instance of the auto triggered node of the internal workflow type, the field value is the actual workflow ID.
nodeId Long The ID of the node for which the auto triggered node instance was generated.
beginWaitResTime Long The time when the auto triggered node instance started to wait for resources.
taskId Long The ID of the auto triggered node instance.
status Integer
The status of the node. Valid values:
  • 0: The node is not running.
  • 2: The node is waiting for the scheduled time specified by the dueTime or cycleTime parameter to arrive.
  • 3: The node is waiting for resources.
  • 4: The node is running.
  • 5: The node failed to be run.
  • 6: The node is run.
  • 7: Data quality is being checked for the node.
  • 8: Branch conditions are being checked.

Message body for a file change event (file commit, deployment, execution, and deletion)

Sample code:
  • Sample code for file commit and deployment
    {
        "operator": "**************",  // The operator.
        "projectId": 123456,
        "tenantId": 123456,
        "nodeId": 123456,    // The node ID.
        "fileType": 123456, // The type of the file.
        "fileName": "********",
        "fileOwner": "****************",         // The owner of the file.
        "extensionBizId": "***************",    //
        "changeType": "UPDATE", //NEW UPDATE DELETE
        "fileCreateTime": "2021-01-15 14:03:02",
        "fileId": 123456,
        "fileVersion": 3,
        "dataSourceName":"odps_first"
    }
  • Sample code for file execution and deletion
    {
        "operator": "**************",  // The operator.
        "projectId": 123456,
        "tenantId": 123456,
        "nodeId": 123456,    // The node ID.
        "fileType": 123456, // The type of the file.
        "fileName": "********",
        "fileOwner": "****************",         // The owner of the file.
        "extensionBizId": "***************",    //
        "fileCreateTime": "2021-01-15 14:03:02",
        "fileId": 123456
    }
Field Type Description
operator String The ID of the Alibaba Cloud account that performed the operation.
projectId Long The ID of the workspace.
tenantId Long The ID of the tenant.
nodeId Long The ID of the node that is run by the scheduling system.
fileType Long The type of the code in the file if the file is a node. Valid values: 6 (Shell), 10 (ODPS SQL), 11 (ODPS MR), 23 (Data Integration), 24 (ODPS Script), 99 (zero load), 221 (PyODPS 2), 225 (ODPS Spark), 227 (EMR Hive), 228 (EMR Spark), 229 (EMR Spark SQL), 230 (EMR MR), 239 (OSS object inspection), 257 (EMR Shell), 258 (EMR Spark Shell), 259 (EMR Presto), 260 (EMR Impala), 900 (real-time synchronization), 1089 (cross-tenant collaboration), 1091 (Hologres development), 1093 (Hologres SQL), 1100 (assignment), and 1221 (PyODPS 3).
fileName String The name of the file.
fileOwner String The owner of the file.
extensionBizId String The unique ID of the checker instance.
changeType String The type of the change. Valid values: UPDATE, DELETE, and CREATE.
fileCreateTime String The time when the file was created. The time is in the yyyy-MM-dd HH:mm:ss format.
fileId Long The ID of the file.
fileVersion Long The version of the file.
dataSourceName String The name of the data source.

Message body for a table change event

Sample code:
{
    "operator": "**************",
    "projectId": 123456,
    "tenantId": 123456,
    "extensionBizId": "123456",
    "tableName":"table1",
    "tableType":"ODPS",  // The type of the table. Valid values: ODPS and EMR.
    "maxComputeProject":"project1"
}
Field Type Description
operator String The ID of the Alibaba Cloud account that performed the operation.
projectId Long The ID of the workspace.
tenantId Long The ID of the tenant.
extensionBizId String The unique ID of the checker instance.
tableName String The name of the table in which the event occurred.
tableType String The type of the table. Valid values:
  • ODPS
  • EMR
maxComputeProject String The name of the MaxCompute project.

Message body for a node change event

Sample code:
{
  "nodeName": "",
  "programType": "ODPS_SQL",
  "cronExpress": "00 20 00 * * ?",
  "schedulerType": "NORMAL",
  "ownerId": "191223248874****",
  "priority": 1,
  "baselineId": 11780****,
  "repeatability": true,
  "modifyTime": 1646364549642,
  "createTime": 1646364549642,
  "datasource": "odps_first",
  "tenantId": 28378948471****,
  "nodeId": 100347****,
  "projectId": 3****
}
Field Type Description
nodeName String The name of the node.
programType String The type of the node. Valid values:
  • 6 (Shell)
  • 10 (ODPS SQL)
  • 11 (ODPS MR)
  • 24 (ODPS Script)
  • 99 (zero load)
  • 221 (PyODPS 2)
  • 225 (ODPS Spark)
  • 227 (EMR Hive)
  • 228 (EMR Spark)
  • 229 (EMR Spark SQL)
  • 230 (EMR MR)
  • 239 (OSS object inspection)
  • 257 (EMR Shell)
  • 258 (EMR Spark Shell)
  • 259 (EMR Presto)
  • 260 (EMR Impala)
  • 900 (real-time synchronization)
  • 1089 (cross-tenant collaboration)
  • 1091 (Hologres development)
  • 1093 (Hologres SQL)
  • 1100 (assignment)
  • 1221 (PyODPS 3)
You can call the ListFileType operation to query the code type of a file.
cronExpress String The CRON expression that represents the periodic scheduling policy of the node. This parameter is equivalent to the Cron Expression parameter in the Schedule section of the Properties panel in the DataWorks console. After you set the Scheduling Cycle and Run At parameters in the DataWorks console, DataWorks automatically generates the value of the Cron Expression parameter. Examples:
  • CRON expression for a node that is scheduled to run at 05:30 every day: 00 30 05 * * ?
  • CRON expression for a node that is scheduled to run at the fifteenth minute of each hour: 00 15 * * * ?
  • CRON expression for a node that is scheduled to run every 10 minutes: 00 00/10 * * * ?
  • CRON expression for a node that is scheduled to run every 10 minutes from 08:00 to 17:00 every day: 00 00-59/10 8-23 * * * ?
  • CRON expression for a node that is scheduled to run at 00:20 on the first day of each month: 00 20 00 1 * ?
  • CRON expression for a node that is scheduled to run every three months from 00:10 on January 1: 00 10 00 1 1-12/3 ?
  • CRON expression for a node that is scheduled to run at 00:05 every Tuesday and Friday: 00 05 00 * * 2,5
Note The scheduling system of DataWorks imposes the following limits on CRON expressions:
  • A node can be scheduled to run at a minimum interval of 5 minutes.
  • A node can be scheduled to run at 00:05 every day at the earliest.
schedulerType String The scheduling type of the node. Valid values:
  • NORMAL(0): The node is an auto triggered node. The node is regularly run.
  • MANUAL(1): The node is a manually triggered node. The node is not regularly run.
  • PAUSE(2): The node is a frozen node. The scheduling system still regularly runs the node but sets the node status to Failed when the scheduling system starts to run the node.
  • SKIP(3): The node is a dry-run node. The scheduling system still regularly runs the node but sets the node status to Succeeded when the scheduling system starts to run the node.
  • SKIP_UNCHOOSE(4): The node is an unselected node in a temporary workflow. This type of node exists only in temporary workflows. The scheduling system sets the node status to Succeeded when the scheduling system starts to run the node.
  • SKIP_CYCLE(5): The node is a node that is scheduled by the week or month and is waiting for the scheduled time to arrive. The scheduling system still regularly runs the node but sets the node status to Succeeded when the scheduling system starts to run the node.
  • CONDITION_UNCHOOSE(6): The node is not selected by an ancestor branch node and is dry run.
  • REALTIME_DEPRECATED(7): The node has instances that are generated in real time but deprecated. The scheduling system sets the node status to Succeeded.
ownerId String The ID of the Alibaba Cloud account used by the owner of the node. If this parameter is not specified, the ID of the Alibaba Cloud account of the user who calls the operation is used.
priority Integer The priority of the node. Valid values: 1, 3, 5, 7, and 8.
baselineId Long The ID of the baseline.
repeatability Boolean Indicates whether the node can be rerun.
modifyTime Long The time when the node was last modified.
createTime Long The time when the node was created.
nodeId Long The ID of the node.
projectId Long The ID of the workspace to which the node belongs.
tenantId Long The ID of the tenant to which the node belongs.

Valid values of eventCategoryType

Event type Value of eventCategoryType
An instance status change event instance-status-change
A file change event file-change
A task change event task-change
An instance change event instance-change
A table change event table-change
A node change event node-change

Valid values of eventType

Extension point Value of eventType
Commit a file commit-file
Deploy a file deploy-file
Run a file run-file
Delete a file delete-file
Commit a table commit-table
Deploy a table deploy-table
Create a node node-change-created
Update a node node-change-updated
Delete a node node-change-deleted