Creates a workflow instance based on configurations, such as a data backfill workflow instance.
Operation description
You must purchase DataWorks Basic Edition or a higher edition to use this feature.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:CreateWorkflowInstances |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectId |
integer |
Yes |
The project ID. |
100 |
| EnvType |
string |
No |
The project environment. Valid values:
Valid values:
|
Prod |
| WorkflowId |
integer |
Yes |
The ID of the workflow. The WorkflowId of a scheduled task is always 1. |
1 |
| Name |
string |
Yes |
The name. |
WorkflowInstance1 |
| Periods |
object |
No |
The data backfill period settings. |
|
| BizDates |
array<object> |
Yes |
The list of business dates. You can specify multiple business date ranges, up to a maximum of 7 ranges. |
|
|
object |
No |
|||
| EndBizDate |
string |
Yes |
The end business date. Format: yyyy-mm-dd. |
2024-11-24 |
| StartBizDate |
string |
Yes |
The start business date. Format: yyyy-mm-dd. |
2024-11-20 |
| EndTime |
string |
No |
The end time of the period. Specify the time in the hh:mm:ss format based on the 24-hour clock. Default value: 23:59:59. If you specify this field, you must also specify StartTime. |
23:59:59 |
| StartTime |
string |
No |
The start time of the period. Specify the time in the hh:mm:ss format based on the 24-hour clock. Default value: 00:00:00. If you specify this field, you must also specify EndTime. |
00:00:00 |
| Type |
string |
Yes |
The type of the workflow instance. Valid values:
Valid values:
|
SupplementData |
| WorkflowParameters |
string |
No |
The workflow parameters. This parameter takes effect only when a specific workflow is specified (WorkflowId != 1). For a periodic workflow or an event-triggered workflow, the format is key=value, and the priority is lower than that of task parameters. For a manually triggered workflow, the format is JSON, and the priority is higher than that of task parameters. |
"key=value" format: key1=value1 key2=value2 JSON format: {"key1":"value1", "key2": "value2"} |
| TaskParameters |
string |
No |
The task parameters, which are used to set parameters for specific tasks. The value is in JSON format. The key is the task ID, and the value format refers to the task script parameters (Task.Script.Parameter in the response of the GetTask operation). |
{ "1001": "key1=val2 key2=val2", "1002": "key1=val2 key2=val2" } |
| AutoStartEnabled |
boolean |
No |
Specifies whether to run the workflow instance immediately after it is created. Default value: true. |
true |
| DefaultRunProperties |
object |
No |
The runtime configurations. |
|
| Alert |
object |
No |
The alert configurations. |
|
| NoticeType |
string |
No |
The notification method. Valid values:
Valid values:
|
Sms |
| Type |
string |
No |
The alert policy. Valid values:
Valid values:
|
Succes |
| Analysis |
object |
No |
The analysis configurations. This parameter is required when Type is set to SupplementData. |
|
| Blocked |
boolean |
No |
Specifies whether to block the run if the analysis fails. This parameter is required when Type is set to SupplementData. |
true |
| Enabled |
boolean |
No |
Specifies whether to enable analysis. This parameter is required when Type is set to SupplementData. |
true |
| DataSourceNameMappings |
object |
No |
The data source name mappings for data backfill runs. The key of the map is DataSource.Name in the task definition, and the value is DataSource.Name used during data backfill runs. This parameter takes effect only when Type is set to SupplementData. If this parameter is not configured, an empty map is passed, or the key is not matched, the task continues to use the original data source. Currently, only EMR Spark SQL, EMR Shell, and EMR Spark tasks are supported. |
|
|
string |
No |
The data source name configured in the task definition, which is DataSource.Name. |
emr_cluster |
|
| ExcludeProjectIds |
array |
No |
The list of project IDs to exclude from the run. |
|
|
integer |
No |
The project ID. |
200 |
|
| ExcludeTaskIds |
array |
No |
The list of task IDs to exclude from the run. |
|
|
integer |
No |
The task ID. |
4321 |
|
| IncludeProjectIds |
array |
No |
The list of project IDs to include in the run. |
|
|
integer |
No |
The project ID. |
100 |
|
| IncludeTaskIds |
array |
No |
The list of task IDs to include in the run. |
|
|
integer |
No |
The task ID. |
1234 |
|
| Mode |
string |
No |
The data backfill mode. Default value: ManualSelection. This parameter is required when Type is set to SupplementData. Valid values:
Valid values:
|
ManualSelection |
| Order |
string |
No |
The run order. Default value: Asc. Valid values:
Valid values:
|
Asc |
| Parallelism |
integer |
No |
The number of parallel tasks. A value of 2 to 10 indicates the parallelism, and a value of 1 indicates serial execution. This parameter is required when Type is set to SupplementData. |
2 |
| Priority |
integer |
No |
The run priority. Valid values: 1 to 11. A larger value indicates a higher priority. These parameter settings are supported only for manually triggered workflows and event-triggered workflows. |
1 |
| PriorityWeightStrategy |
string |
No |
The priority weight policy. These parameter settings are supported only for manually triggered workflows and event-triggered workflows. Valid values:
Valid values:
|
Upstream |
| RootTaskIds |
array |
No |
The list of root task IDs.
|
|
|
integer |
No |
The task ID. |
1234 |
|
| RunPolicy |
object |
No |
The run policy. If this field is left empty, the task configuration is used. |
|
| EndTime |
string |
No |
The end time of the run. Specify the time in the hh:mm:ss format based on the 24-hour clock. This field is required if you configure a run policy. |
23:59:59 |
| Immediately |
boolean |
No |
Specifies whether the run can be started immediately if the run time is in the future. Default value: false. |
false |
| StartTime |
string |
No |
The start time of the run. Specify the time in the hh:mm:ss format based on the 24-hour clock. This field is required if you configure a run policy. |
00:00:00 |
| Type |
string |
No |
The period type. This field is required if you configure a run policy. Valid values:
Valid values:
|
Daily |
| RuntimeResource |
string |
No |
The identifier of the custom scheduling resource group. If this field is left empty, the task configuration is used. |
S_res_group_524258031846018_1684XXXXXXXXX |
| Comment |
string |
No |
The reason for creation. |
create for test |
| Tags |
array<object> |
No |
The list of task tags. |
|
|
object |
No |
|||
| Key |
string |
No |
The tag key. |
tagKey |
| Value |
string |
No |
The tag value. |
tagValue |
| TagCreationPolicy |
string |
No |
The tag creation policy. Valid values:
Valid values:
|
Append |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| OperationId |
string |
The operation ID. You can use this field to query the result of the creation operation by calling the GetCreateWorkflowInstancesResult operation. |
e15ad21c-b0e9-4792-8f55-b037xxxxxxxx |
| RequestId |
string |
The request ID. You can use this ID to locate logs and troubleshoot issues. |
22C97E95-F023-56B5-8852-B1A77A17XXXX |
Examples
Success response
JSON format
{
"OperationId": "e15ad21c-b0e9-4792-8f55-b037xxxxxxxx",
"RequestId": "22C97E95-F023-56B5-8852-B1A77A17XXXX"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.