Trigger Node Development Instructions

更新时间: 2026-06-23 11:46:55

If your data system spans multiple platforms with cross-platform task dependencies, you can use trigger nodes to manage them. For example, if an algorithm is developed in System A, a recurring task in Dataphin can be configured to run only after that algorithm produces its output.

Prerequisites

To use external trigger nodes, ensure the following conditions are met:

  • You have purchased the Dataphin OpenAPI feature.

  • The environment that sends the trigger request must have network connectivity to Dataphin.

Basic characteristics of trigger nodes

Trigger nodes differ from other compute nodes in the following ways:

  • A recurring instance of a trigger node starts to run when the following conditions are met:

    1. The current system time is later than or equal to the scheduled runtime of the instance. This is the same as other compute nodes.

    2. As with other compute tasks, the runtime status of all ancestor nodes is Succeeded.

    3. An external trigger request has been received. This condition is unique to trigger nodes.

  • Data backfill instances for trigger nodes do not depend on external trigger requests. This is the same as for other compute nodes.

Trigger Methods

Dataphin supports external triggers only through the OpenAPI. An external system sends a trigger request via the OpenAPI to start a trigger node.

External trigger

To use an external trigger, complete the following steps:

  1. Obtain the trigger information.

    Before sending an external trigger request, obtain the following information:

    • Node ID (node_id): Find the node ID in the Basic Information section of the Properties panel for the submitted trigger node.

    • Project ID (project_id): Find the project ID in the URL of your browser on the Develop page. For example, if the URL is https://www.aliyun.com/dev/codeManage/698348****632?env=DEV&projectId=6982117****30048&tenantId=309107012, the project ID is 6982117****30048.

    • Tenant ID (tenant_id): Find the tenant ID in the URL of your browser on the Develop page. For example, if the URL is https://www.aliyun.com/dev/codeManage/698348****632?env=DEV&projectId=6982117****30048&tenantId=309***012, the tenant ID is 309***012.

  2. Write the trigger node code.

    The following example uses Java.

    Important

    Obtain the required JAR packages from the Alibaba Cloud helpdesk. For more information, see Online Customer Service.

    DefaultProfile profile = DefaultProfile.getProfile("<Your region>",
                    "<Dataphin accessKey>", "<Dataphin secret>");
            DefaultProfile.addEndpoint("<Your region>", "dataphin-public", "<Your openapi endpoint>");
            profile.getHttpClientConfig().setIgnoreSSLCerts(true);
            
            DefaultAcsClient client =  new DefaultAcsClient(profile);
            ExecuteTriggerNodeRequest request = new ExecuteTriggerNodeRequest();
            // Set the ID of the tenant where the node to be triggered is located.
            request.setOpTenantId(0L);
            // Set the data timestamp for the recurring instance to be triggered. The format is yyyy-MM-dd.
            request.setBizDate("<bizdate>");
            // Set the ID of the node to be triggered.
            request.setNodeId("<node_id>");
            // Set the ID of the project where the node to be triggered is located.
            request.setProjectId(0L);
            // Set the environment type.
            request.setEnv("PROD");
            ExecuteTriggerNodeResponse response = client.getAcsResponse(request);
            System.out.println(response.getCode());
  3. After the code runs successfully and Dataphin receives the trigger request, the trigger node status changes to Succeeded.

上一篇: Configure Spark SQL task parameters 下一篇: Scheduling dependency rules and examples
阿里云首页 智能数据建设与治理 Dataphin 相关技术圈