Integrate WeCom Approval Workflows
Connect WeCom approval templates and callback events to NineData so that database DevOps tasks can use WeCom for approval.
Before you begin
- You have already created or joined an organization, and the organization has subscribed to DevOps Enterprise. Please ensure that your annual or monthly subscription is still active. For more information, please refer to Manage Organizations.
- Your current account has been switched to the target organization. For more information, please refer to Switching to an Organization.
- Sign in to WeCom as an enterprise administrator.
- The NineData deployment is a Dedicated Cluster.
- You have system administrator permissions in NineData.
- The WeCom organization has been configured with its departments and employee phone numbers or account names.
Step 1: Create a WeCom self-built application
- Sign in to WeCom.
- Open Applications > Applications, find Self-built, and click Create Application.
- Enter the application logo, name, description, and visibility scope. Save the application and record
corpId,appSecret,token, andencodingAesKeyfrom the application details. - In the developer interface settings, configure the trusted domain and add the public IP address of the NineData server to Enterprise Trusted IP.
Step 2: Create a WeCom approval template
- Open the WeCom approval management page.
- Under Template Management, click Add Template > Custom Template.
- Design the form and workflow as required, and publish the template.
- Do not use Applicant selects approver when configuring approvers, because the WeCom API call will fail. Set a visibility scope that includes all users who need to submit approvals.
- Record the ID at the end of the template URL.
Step 3: Authorize the template and application
- In WeCom, open Applications > Applications and select the Approval application.
- Click API.
- Add the template from Step 2 to Templates for Callback Notifications.
- Under Applications Allowed to Call APIs, select the self-built application from Step 1 and confirm.
Step 4: Bind the WeCom application in NineData
Sign in to the NineData Console.
- In the left navigation bar, click DevOps > Policy & Process.
- Open Approval Process and click External approve channel.
- Click Add External Approval Channel and enter the WeCom application information, then click OK.
- Click the new application ID and record Callback url. This URL must be publicly reachable from WeCom.
- Open Approval Process Mapping Definitions, create a mapping definition, and map the NineData fields to the fields in the WeCom template from Step 2.
Step 5 (Optional): Configure the callback URL
- In WeCom, open the target application.
- Under Receive Messages, click Set API Receive.
- Enter the callback URL, token, and encoding AES key required by the application, then save.
Step 6: Bind the approval workflow
Sign in to the NineData Console.
- In the left navigation bar, click DevOps > Policy & Process.
- Open Approval Process, select the target process, and open Details.
- Select the task type, click Edit, enable Launch External Approval Workflow, select the WeCom application, select the corresponding WeCom workflow ID, and click OK.