UpdateWorkflow
Updates a specified workflow by using a full update. The following fields can be synchronously updated in DataStudio: owner, data source, scheduling resource group, description, and trigger run mode (normal, dry run, or paused).
Operation description
You must purchase DataWorks Basic Edition or a higher edition to use this operation.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dataworks:* |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Id |
integer |
Yes |
The workflow ID. |
1234 |
| EnvType |
string |
No |
The project environment. Valid values:
Valid values:
|
Prod |
| Name |
string |
Yes |
The name. |
My Workflow |
| Owner |
string |
Yes |
The account ID of the owner. |
1000 |
| Trigger |
object |
Yes |
The trigger method. |
|
| Type |
string |
Yes |
The trigger type. Valid values:
Valid values:
|
Scheduler |
| Cron |
string |
No |
The cron expression. This parameter takes effect only when Type is set to Scheduler. |
00 00 00 * * ? |
| StartTime |
string |
No |
The start time of the periodic trigger. This parameter takes effect only when Type is set to Scheduler. Format: |
1970-01-01 00:00:00 |
| EndTime |
string |
No |
The end time of the periodic trigger. This parameter takes effect only when Type is set to Scheduler. Format: |
9999-01-01 00:00:00 |
| Description |
string |
No |
The description. |
test |
| Dependencies |
array<object> |
No |
The dependency information. |
|
|
object |
No |
|||
| Type |
string |
Yes |
The dependency type. Valid values:
Valid values:
|
Normal |
| UpstreamOutput |
string |
No |
The output identifier of the upstream node. This field is returned when the dependency type is |
pre.odps_sql_demo_0 |
| UpstreamTaskId |
integer |
No |
The ID of the upstream node. This field is returned when the dependency type is |
1234 |
| Parameters |
string |
No |
The parameter list. |
para1=$bizdate para2=$[yyyymmdd] |
| Tasks |
array<object> |
No |
The list of tasks. |
|
|
array<object> |
No |
|||
| Id |
integer |
No |
The task ID. If you specify this field, a full update is performed on the corresponding task. If you leave this field empty, a new task is created. |
1234 |
| Name |
string |
Yes |
The name of the task. |
SQL node |
| Description |
string |
No |
The description. |
Test |
| Type |
string |
Yes |
The task type. |
ODPS_SQL |
| Owner |
string |
Yes |
The account ID of the owner. |
1000 |
| BaseLineId |
integer |
No |
The baseline ID. |
1234 |
| Timeout |
integer |
No |
The timeout period for task execution, in seconds. |
3600 |
| RerunMode |
string |
Yes |
Specifies whether the task can be rerun. Valid values:
Valid values:
|
AllAllowed |
| RerunTimes |
integer |
No |
The number of retries. This parameter takes effect only when the task is configured to be rerunnable. |
3 |
| RerunInterval |
integer |
No |
The retry interval, in seconds. |
60 |
| Script |
object |
No |
The script information. |
|
| Content |
string |
No |
The script content. |
echo "helloWorld" |
| Parameters |
string |
No |
The list of script parameters. |
para1=$bizdate |
| Trigger |
object |
Yes |
The trigger method of the task. |
|
| Type |
string |
No |
The trigger type. Valid values:
Valid values:
|
Scheduler |
| Recurrence |
string |
Yes |
The running mode upon triggering. This parameter takes effect only when type is set to Scheduler. Valid values:
Valid values:
|
Normal |
| RuntimeResource |
object |
Yes |
The runtime environment configuration, such as the resource group information. |
|
| ResourceGroupId |
string |
Yes |
The identifier of the scheduling resource group configured for task execution. |
S_res_group_524258031846018_1684XXXXXXXXX |
| Image |
string |
No |
The ID of the image configured for task execution. |
i-xxxxxx |
| Cu |
string |
No |
The number of compute units (CUs) consumed during task execution. |
0.25 |
| DataSource |
object |
No |
The associated data source information. |
|
| Name |
string |
No |
The name of the data source. |
odps_test |
| Inputs |
object |
No |
The input information. Note: If this field is left empty, all Inputs configurations are deleted by default. |
|
| Variables |
array<object> |
No |
The list of variable definitions. Note: If this field is not specified or is an empty array, all Inputs.Variables configurations are deleted by default. |
|
|
object |
No |
|||
| Name |
string |
No |
The name of the variable. |
key1 |
| Type |
string |
Yes |
The variable type. Valid values:
Valid values:
|
Constant |
| Value |
string |
No |
The value of the variable. |
value1 |
| Outputs |
object |
No |
The output information. Note: If this field is left empty, all Outputs configurations are deleted by default. |
|
| TaskOutputs |
array<object> |
No |
The list of task output definitions. Note: If this field is not specified or is an empty array, all TaskOutputs configurations are deleted by default. |
|
|
object |
No |
|||
| Output |
string |
No |
The output identifier. |
pre.odps_sql_demo_0 |
| Variables |
array<object> |
No |
The list of variable definitions. Note: If this field is not specified or is an empty array, all Outputs.Variables configurations are deleted by default. |
|
|
object |
No |
|||
| Name |
string |
No |
The name of the variable. |
key1 |
| Type |
string |
Yes |
The variable type. Valid values:
Valid values:
|
Constant |
| Value |
string |
No |
The value of the variable. |
value1 |
| Dependencies |
array<object> |
No |
The dependency information. Note: If this field is not specified or is an empty array, all Dependencies configurations are deleted by default. |
|
|
object |
No |
|||
| Type |
string |
Yes |
The dependency type. Valid values:
Valid values:
|
Normal |
| UpstreamOutput |
string |
No |
The output identifier of the upstream node. This field is returned when the dependency type is |
pre.odps_sql_demo_0 |
| UpstreamTaskId |
integer |
No |
The ID of the upstream node. This field is returned when the dependency type is |
1234 |
| Tags |
array<object> |
No |
The list of task tags. Note: If this field is not specified or is an empty array, all Tags configurations are deleted by default. |
|
|
object |
No |
|||
| Key |
string |
Yes |
The tag key. |
key1 |
| Value |
string |
No |
The tag value. |
value1 |
| ClientUniqueCode |
string |
No |
The client unique code of the task, which is used to implement asynchronous processing and idempotence. If you do not specify this parameter when creating a task, the system automatically generates one and uniquely binds it to the resource ID. If you specify this parameter when updating or deleting a resource, it must be the same as the client unique code used during creation. |
Task_0bc5213917368545132902xxxxxxxx |
| EnvType |
string |
No |
The project environment. Valid values:
Valid values:
|
Prod |
| Outputs |
object |
No |
The output information. |
|
| TaskOutputs |
array<object> |
No |
The list of workflow task output definitions. |
|
|
object |
No |
|||
| Output |
string |
No |
The output identifier. |
pre.odps_sql_demo_0 |
| Tags |
array<object> |
No |
The list of workflow tags. |
|
|
object |
No |
|||
| Key |
string |
Yes |
The tag key. |
key1 |
| Value |
string |
No |
The tag value. |
value1 |
| ClientUniqueCode |
string |
No |
The client unique code of the workflow, which is used to implement asynchronous processing and idempotence. If you do not specify this parameter when creating a workflow, the system automatically generates one and uniquely binds it to the resource ID. If you specify this parameter when updating or deleting a resource, it must be the same as the client unique code used during creation. |
Workflow_0bc5213917368545132902xxxxxxxx |
| InstanceMode |
string |
No |
The instance generation mode. Valid values:
Valid values:
|
T+1 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The ID of the request. You can use the ID to locate logs and troubleshoot issues. |
22C97E95-F023-56B5-8852-B1A77A17XXXX |
| Success |
boolean |
Indicates whether the operation was successful. |
true |
Examples
Success response
JSON format
{
"RequestId": "22C97E95-F023-56B5-8852-B1A77A17XXXX",
"Success": true
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.