CreateWorkflowInstances
Creates a workflow instance from the specified configuration, for example, a data backfill workflow instance.
Operation description
You must purchase DataWorks Basic Edition or higher to use this operation.
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 to which the task belongs. The WorkflowId of all scheduled tasks is 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: |
2024-11-24 |
| StartBizDate |
string |
Yes |
The start business date. Format: |
2024-11-20 |
| EndTime |
string |
No |
The end time of the period. Specify the time in the 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 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" format: key1=value1 key2=value2 JSON format: {"key1":"value1", "key2": "value2"} |
| TaskParameters |
string |
No |
The parameters for specific tasks, in JSON format. Each key is a task ID, and each value follows the format of 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:
|
Success |
| 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 used during data backfill runs. The key in the map is DataSource.Name in the task definition, and the value is DataSource.Name used during the data backfill run. 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 does not match, the task continues to use the original data source. Currently, only EMR Spark SQL, EMR Shell, and EMR Spark tasks are supported. |
{"emr_cluster":"emr_cluster"} |
|
string |
No |
The data source name configured in the task definition, namely 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 tasks to run in parallel. Use a value from 2 to 10 for parallel execution, or 1 for sequential 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 manual business flows and event-triggered workflows. |
1 |
| PriorityWeightStrategy |
string |
No |
The priority weight policy. These parameter settings are supported only for manual business flows 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 run time. Specify the time in the |
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 run time. Specify the time in the |
00:00:00 |
| Type |
string |
No |
The time period type. This field is required if a run policy is configured. 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 the creation. |
create for test |
| Tags |
array<object> |
No |
The list of tags for the task. |
|
|
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:
|
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.