UpdateWorkflow

Updated at:

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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:

  • Prod: production

  • Dev: development

Valid values:

  • Prod :

    Production.

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:

  • Scheduler: triggered by a scheduling cycle

  • Manual: manually triggered

Valid values:

  • Scheduler :

    Triggered by a scheduling cycle.

  • Manual :

    Manually triggered.

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: yyyy-mm-dd hh:mm:ss.

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: yyyy-mm-dd hh:mm:ss.

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:

  • CrossCycleDependsOnChildren: cross-cycle dependency on child nodes of the first level

  • CrossCycleDependsOnSelf: cross-cycle dependency on the node itself

  • CrossCycleDependsOnOtherNode: cross-cycle dependency on other nodes

  • Normal: same-cycle dependency

Valid values:

  • CrossCycleDependsOnChildren :

    Cross-cycle dependency on child nodes of the first level.

  • CrossCycleDependsOnOtherNode :

    Cross-cycle dependency on other nodes.

  • CrossCycleDependsOnSelf :

    Cross-cycle dependency on the node itself.

  • Normal :

    Same-cycle dependency.

Normal

UpstreamOutput

string

No

The output identifier of the upstream node. This field is returned when the dependency type is Normal and the input content is specified.

pre.odps_sql_demo_0

UpstreamTaskId

integer

No

The ID of the upstream node. This field is returned when the dependency type is CrossCycleDependsOnOtherNode or Normal and the input content is not specified. This field is not returned in other cases.

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:

  • AllDenied: The task cannot be rerun regardless of whether it succeeds or fails.

  • FailureAllowed: The task can be rerun only if it fails.

  • AllAllowed: The task can be rerun regardless of whether it succeeds or fails.

Valid values:

  • AllDenied :

    The task cannot be rerun regardless of whether it succeeds or fails.

  • FailureAllowed :

    The task can be rerun only if it fails.

  • AllAllowed :

    The task can be rerun regardless of whether it succeeds or fails.

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:

  • Scheduler: triggered by a scheduling cycle

  • Manual: manually triggered

Valid values:

  • Scheduler :

    Triggered by a scheduling cycle.

  • Manual :

    Manually triggered.

Scheduler

Recurrence

string

Yes

The running mode upon triggering. This parameter takes effect only when type is set to Scheduler. Valid values:

  • Pause: The task is paused.

  • Skip: The task performs a dry run.

  • Normal: The task runs normally.

Valid values:

  • Pause :

    The task is paused.

  • Skip :

    The task performs a dry run.

  • Normal :

    The task runs normally.

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:

  • Constant: constant

  • PassThrough: parameter node output

  • System: variable

  • NodeOutput: script output

Valid values:

  • Constant :

    Constant.

  • PassThrough :

    Parameter node output.

  • NodeOutput :

    Script output.

  • System :

    Variable.

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:

  • Constant: constant

  • PassThrough: parameter node output

  • System: variable

  • NodeOutput: script output

Valid values:

  • Constant :

    Constant.

  • PassThrough :

    Parameter node output.

  • NodeOutput :

    Script output.

  • System :

    Variable.

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:

  • CrossCycleDependsOnChildren: cross-cycle dependency on child nodes of the first level

  • CrossCycleDependsOnSelf: cross-cycle dependency on the node itself

  • CrossCycleDependsOnOtherNode: cross-cycle dependency on other nodes

  • Normal: same-cycle dependency

Valid values:

  • CrossCycleDependsOnChildren :

    Cross-cycle dependency on child nodes of the first level.

  • CrossCycleDependsOnOtherNode :

    Cross-cycle dependency on other nodes.

  • CrossCycleDependsOnSelf :

    Cross-cycle dependency on the node itself.

  • Normal :

    Same-cycle dependency.

Normal

UpstreamOutput

string

No

The output identifier of the upstream node. This field is returned when the dependency type is Normal and the input content is specified.

pre.odps_sql_demo_0

UpstreamTaskId

integer

No

The ID of the upstream node. This field is returned when the dependency type is CrossCycleDependsOnOtherNode or Normal and the input content is not specified. This field is not returned in other cases.

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:

  • Prod: production

  • Dev: development

Valid values:

  • Prod :

    Production.

  • Dev :

    Development.

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:

  • T+1: Generated on the next day.

  • Immediately: Generated immediately. Note: Periodic instances are generated normally only if the scheduled time of the workflow is at least 10 minutes after the workflow is published. Real-time instance generation is not supported during the full instance generation period (22:00 to 24:00). You can submit and publish workflows during this period, but instances are not regenerated after submission.

Valid values:

  • Immediately :

    Generated immediately.

  • T+1 :

    Generated on the next day.

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.