After you configure mappings for imported tables, you can run scheduling tasks from the compute source to calculate ID mappings. After the tasks are complete, the results are stored in the analysis source.
You can start a schedule in three ways:
Manual scheduling: Start a schedule manually after the base table is updated.
Recurring schedule: Automatically start a schedule daily or hourly. This method is suitable for base tables that are updated on a fixed schedule.
Triggered schedule: Start a schedule by sending a request through an API. This method is suitable for triggering a schedule using an API call after a data transformation job for the base table is complete.
Some scheduling tasks are imported using an API. For these tasks, the creator is listed as API Sync, and the scheduling method is either recurring or manual. You can view the execution records for these tasks and manually run the tasks that are set for manual scheduling. However, you cannot manually run the recurring tasks, or edit or delete any of these API-imported tasks.
Create a scheduling task
Each time a schedule runs, ID mappings are recalculated for all users across all involved data tables. To avoid excessive use of compute resources, create a single task to schedule all your data tables.
Create a manual scheduling task
Procedure:
Go to Workspace > Configuration Management > Data Access Management > Data Import > Scheduling Tasks.

In the upper-right corner, click New Scheduling Task.
In the dialog box that appears, enter a task name and select the data tables to import. You can select multiple tables or all tables.

Set Scheduling Frequency to Manual Scheduling.
Click Save to create the scheduling task.
The task is added to the task list. To run the task, you can click the
icon to start it manually.
Create a recurring scheduling task
Procedure:
Go to Workspace > Configuration Management > Data Access Management > Data Import > Scheduling Tasks.

In the upper-right corner, click New Scheduling Task.
In the dialog box that appears, enter a task name and select the data tables to import. You can select multiple tables or all tables.

Set Scheduling Frequency to Daily or Hourly, and configure the execution cycle.
Click Save to create the scheduling task.
The task is added to the task list and runs automatically at the specified time.
Create a triggered scheduling task
Procedure:
Go to Workspace > Configuration Management > Data Access Management > Data Import > Scheduling Tasks.

In the upper-right corner, click New Scheduling Task.
In the dialog box that appears, enter a task name and select the data tables to import. You can select multiple tables or all tables.

Set Scheduling Frequency to Triggered Scheduling. A trigger URL with a token is generated for each table. Click Copy and save these URLs.
Click Save to create the scheduling task.
The task is added to the task list. To run the task, use these URLs to start it. The rules are as follows:
In the base table's data transformation job in Dataphin, DataWorks, or another extract, transform, and load (ETL) tool, you can write code to call this API or make a request using a webhook.
For script examples for Dataphin and DataWorks, see Appendix: Triggered scheduling script examples.
If a single scheduling task includes multiple tables, you must send a scheduling request for each table using its corresponding URL. The scheduling task runs only after all tables have been triggered.
In the task list, you can click Edit to view the trigger status of each table. Tables that have been scheduled using a URL request show a status of "Triggered". If some tables show a status of "Not Triggered", you must send a request using their corresponding URLs. The task starts when all tables have a status of "Triggered".
Any new scheduling requests received while the task is running are ignored.
Edit a scheduling task
You can click Edit to modify a scheduling task. The procedure is the same as creating a task. The new settings take effect in the next scheduled run.
Manual scheduling
You can manually start not only manual tasks but also recurring and triggered tasks.
You can click Manual Schedule to start a task manually.
View execution results
After a scheduling task runs at least once, the list shows the status of the most recent execution (Succeeded/Failed).
If a task fails, you can hover your mouse over Failed to view the reason for the failure. This information can help you troubleshoot the problem.

You can click Execution Records to go to the execution record list. On this page, you can view the record and status for each run of the scheduling task, as shown in the following figure.
You can click the
icon to expand the execution details for all data tables that are included in a specific run.
Remove a scheduling task
To delete a scheduling task, click the
icon and select Remove. After you confirm the deletion, the task is deleted. However, the data that was retrieved by this task is retained.
Appendix: Triggered scheduling script examples
The following sections provide script examples for triggering data import scheduling tasks in Dataphin and DataWorks.
Dataphin
To trigger an import scheduling task in Dataphin using a recurring Shell task, follow these steps:
Add all the trigger URLs that were generated when you created the triggered scheduling task to the sandbox whitelist as IP addresses that can be accessed. For more information, see Add an IP address to the Dataphin sandbox whitelist.
Create a new recurring Shell task. For more information, see Create a Shell task. Set Scheduling Type to Recurring Task.
If a single scheduling task includes multiple tables, multiple trigger URLs are generated. You must create a separate recurring Shell task for each URL.
The following is a Shell script example:
#!/bin/bash # Replace {trigger_address_URL} with your trigger address URL QA_TRIGGER_URL="{trigger_address_URL}" echo $(date "+%Y-%m-%d %H:%M:%S") "QuickAudience Trigger scheduling Start." echo $(date "+%Y-%m-%d %H:%M:%S") "QuickAudience Trigger scheduling Url:" $QA_TRIGGER_URL result=$(curl -k -s ${QA_TRIGGER_URL}) if [ ! -n "$result" ]; then echo $(date "+%Y-%m-%d %H:%M:%S") "QuickAudience Trigger Failed" $result else echo $(date "+%Y-%m-%d %H:%M:%S") "QuickAudience Trigger scheduling Response:" $result echo $(date "+%Y-%m-%d %H:%M:%S") "QuickAudience Trigger scheduling End." fi(Optional) You can manually run the Shell task to test whether it can successfully trigger the import scheduling task. Check the output log for the following success message:
QuickAudience Trigger scheduling Response: {"data":"true","errorCode":null,"errorDesc":null,"exStack":null,"opers":[],"solution":null,"success":true,"traceId":"0bc1409e16667784903588235e2ef1"}Configure the scheduling for the Shell task. For more information, see Scheduling Configuration.
You can click New Upstream Dependency to associate the task with the ancestor node that produces the data for the current data table. The Shell task is triggered after the ancestor node has produced its data and the scheduled time is reached.
The import scheduling task is triggered after all the Shell tasks that correspond to its trigger URLs have been triggered.
DataWorks
DataWorks supports two ways to trigger import scheduling tasks: Shell nodes and PyODPS 3 nodes.
Shell node
To trigger an import scheduling task in DataWorks using a Shell node, follow these steps:
Shell nodes require an exclusive resource group for scheduling. You must configure one as described in Exclusive resource groups for scheduling.
Otherwise, the Shell node scheduling fails and the following error message is displayed:
curl: (1) Protocol https not supported or disabled in libcurlCreate a new Shell node. For more information, see Shell nodes.
If a single scheduling task includes multiple tables, multiple trigger URLs are generated. You must create a separate Shell node for each URL.
The following is a Shell script example:
#!/bin/bash # Replace {trigger_address_URL} with your trigger address URL QA_TRIGGER_URL="{trigger_address_URL}" echo $(date "+%Y-%m-%d %H:%M:%S") "QuickAudience Trigger scheduling Start." echo $(date "+%Y-%m-%d %H:%M:%S") "QuickAudience Trigger scheduling Url:" $QA_TRIGGER_URL result=$(curl -k -s ${QA_TRIGGER_URL}) if [ ! -n "$result" ]; then echo $(date "+%Y-%m-%d %H:%M:%S") "QuickAudience Trigger Failed" $result else echo $(date "+%Y-%m-%d %H:%M:%S") "QuickAudience Trigger scheduling Response:" $result echo $(date "+%Y-%m-%d %H:%M:%S") "QuickAudience Trigger scheduling End." fi(Optional) You can manually run the Shell node to test whether it can successfully trigger the import scheduling task. Check the output log for the following success message:
QuickAudience Trigger scheduling Response: {"data":"true","errorCode":null,"errorDesc":null,"exStack":null,"opers":[],"solution":null,"success":true,"traceId":"0bc1409e16667784903588235e2ef1"}Configure the scheduling for the Shell node. For more information, see Configure scheduling dependencies.
As shown in the following figure, you can create a new upstream dependency and associate it with the ancestor node that produces the data for the current data table. The Shell node is triggered after the ancestor node has produced its data and the scheduled time is reached.

The import scheduling task is triggered after all the Shell nodes that correspond to its trigger URLs have been triggered.
PyODPS 3 node
To trigger an import scheduling task in DataWorks using a PyODPS 3 node, follow these steps:
PyODPS 3 nodes can be scheduled using either a public resource group or an exclusive resource group for scheduling.
The public resource group is enabled by default. For more information, see Public resource groups.
To configure an exclusive resource group for scheduling, see Exclusive resource groups for scheduling.
Create a new PyODPS 3 node. For more information, see PyODPS 3 nodes.
If a single scheduling task includes multiple tables, multiple trigger URLs are generated. You must create a separate PyODPS 3 node for each URL.
The following is a Python 3 script example:
import requests from datetime import datetime # Replace {trigger_address} with your trigger address QA_TRIGGER_URL = "{trigger_address}" print(datetime.now().strftime("%Y-%m-%d %H:%M:%S") + " QuickAudience Trigger scheduling Start.") print(datetime.now().strftime("%Y-%m-%d %H:%M:%S") + " QuickAudience Trigger scheduling Url:" + QA_TRIGGER_URL) response = requests.get(QA_TRIGGER_URL) print(datetime.now().strftime("%Y-%m-%d %H:%M:%S") + " QuickAudience Trigger scheduling Response:" + response.text) print(datetime.now().strftime("%Y-%m-%d %H:%M:%S") + " QuickAudience Trigger scheduling End.")(Optional) You can manually run the PyODPS 3 node to test whether it can successfully trigger the import scheduling task. Check the output log for the following success message:
QuickAudience Trigger scheduling Response: {"data":"true","errorCode":null,"errorDesc":null,"exStack":null,"opers":[],"solution":null,"success":true,"traceId":"0bc1409e16667784903588235e2ef1"}Configure the scheduling for the PyODPS 3 node. For more information, see Configure scheduling dependencies.
As shown in the following figure, you can create a new upstream dependency and associate it with the ancestor node that produces the data for the current data table. The PyODPS 3 node is triggered after the ancestor node has produced its data and the scheduled time is reached.

The import scheduling task is triggered after all the PyODPS 3 nodes that correspond to its trigger URLs have been triggered.


