All Products
Search
Document Center

DataWorks:CreateWorkflowInstances

Last Updated:Oct 09, 2026

Creates a workflow instance based on the specified configurations, such as a data backfill workflow instance.

Operation description

DataWorks Basic Edition or later is required.

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: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:

  • Prod: production.

  • Dev: development.

Valid values:

  • Prod :

    Production.

  • Dev :

    Development.

Prod

WorkflowId

integer

Yes

The ID of the workflow to which the task belongs. The WorkflowId of a periodic 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

StartBizDate

string

Yes

The start business date. Format: yyyy-mm-dd.

2024-11-20

EndBizDate

string

Yes

The end business date. Format: yyyy-mm-dd.

2024-11-24

StartTime

string

No

The start time of the period. Format: hh:mm:ss in 24-hour format. Default value: 00:00:00.

If you specify this field, you must also specify the EndTime field.

00:00:00

EndTime

string

No

The end time of the period. Format: hh:mm:ss in 24-hour format. Default value: 23:59:59.

If you specify this field, you must also specify the StartTime field.

23:59:59

Type

string

Yes

The type of the workflow instance. Valid values:

  • SupplementData: data backfill. The methods for specifying RootTaskIds and IncludeTaskIds vary based on the data backfill pattern. For more information, see the parameter description of DefaultRunProperties.Mode.

  • ManualWorkflow: manual workflow. You must set WorkflowId to the ID of the manual workflow. RootTaskIds is optional. If you do not specify RootTaskIds, the default root node list of the manual workflow is used.

  • Manual: manual task. You only need to specify RootTaskIds, which is the list of manual tasks to be run.

  • SmokeTest: smoke test. You only need to specify RootTaskIds, which is the list of test tasks to be run.

  • TriggerWorkflow: trigger-based workflow. You must set WorkflowId to the ID of the trigger-based workflow. IncludeTaskIds is optional. If you do not specify IncludeTaskIds, the entire workflow is run.

Valid values:

  • SmokeTest :

    Smoke test. You only need to specify RootTaskIds, which is the list of test tasks to be run.

  • TriggerWorkflow :

    Trigger-based workflow. You must set WorkflowId to the ID of the trigger-based workflow. IncludeTaskIds is optional. If you do not specify IncludeTaskIds, the entire workflow is run.

  • Manual :

    Manual task. You only need to specify RootTaskIds, which is the list of manual tasks to be run.

  • SupplementData :

    Data backfill. The methods for specifying RootTaskIds and IncludeTaskIds vary based on the data backfill pattern. For more information, see the parameter description of DefaultRunProperties.Mode.

  • ManualWorkflow :

    Manual workflow. You must set WorkflowId to the ID of the manual workflow. RootTaskIds is optional. If you do not specify RootTaskIds, the default root node list of the manual workflow is used.

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 a trigger-based workflow, the format is key=value, and the priority is lower than that of task parameters. For a manual 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. You can use this parameter to set parameters for specific tasks. The value is in JSON format. The key is the task ID. For the format of the value, refer 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 instance immediately after it is created. Default value: true.

true

DefaultRunProperties

object

No

The runtime configurations.

RootTaskIds

array

No

The list of root task IDs.

  • When Type is set to SupplementData, RootTaskIds is required except when Mode is set to Chain.

  • When Type is set to ManualWorkflow, RootTaskIds is optional. If you do not specify RootTaskIds, the default root node list of the manual workflow is used.

  • When Type is set to Manual, RootTaskIds is required and specifies the list of manual tasks to be run.

  • When Type is set to SmokeTest, RootTaskIds is required and specifies the list of test tasks to be run.

integer

No

The task ID.

1234

IncludeTaskIds

array

No

The list of task IDs to be run.

integer

No

The task ID.

1234

ExcludeTaskIds

array

No

The list of task IDs not to be run.

integer

No

The task ID.

4321

IncludeProjectIds

array

No

The list of project IDs to be run.

integer

No

The project ID.

100

ExcludeProjectIds

array

No

The list of project IDs not to be run.

integer

No

The project ID.

200

Mode

string

No

The data backfill mode. Default value: ManualSelection. This parameter is required when Type is set to SupplementData. Valid values:

  • General: general mode. You can specify only one ID in RootTaskIds. IncludeTaskIds is optional. If you do not specify IncludeTaskIds, the tasks in RootTaskIds are included by default.

  • ManualSelection: manual selection mode. You can specify multiple IDs in RootTaskIds. IncludeTaskIds is optional. If you do not specify IncludeTaskIds, the tasks in RootTaskIds are included by default.

  • Chain: chain mode. RootTaskIds must be left empty. You must specify two IDs in IncludeTaskIds, which are the start and end tasks.

  • AllDownstream: all downstream mode. You can specify only one ID in RootTaskIds.

Valid values:

  • Chain :

    Chain mode.

  • ManualSelection :

    Manual selection.

  • General :

    General mode.

  • Huge :

    Massive mode.

  • AllDownstream :

    All downstream.

ManualSelection

Analysis

object

No

The analysis configurations. This parameter is required when Type is set to SupplementData.

Enabled

boolean

No

Specifies whether to enable analysis. This parameter is required when Type is set to SupplementData.

true

Blocked

boolean

No

Specifies whether to block the run if the analysis fails. This parameter is required when Type is set to SupplementData.

true

RunPolicy

object

No

The run policy. If this field is left empty, the task configuration is used.

StartTime

string

No

The start time of the run. Format: hh:mm:ss in 24-hour format. This field is required if you configure a run policy.

00:00:00

EndTime

string

No

The end time of the run. Format: hh:mm:ss in 24-hour format. This field is required if you configure a run policy.

23:59:59

Type

string

No

The period type. This field is required if you configure a run policy. Valid values:

  • Daily: every day.

  • Weekend: weekends only.

Valid values:

  • Daily :

    Every day.

  • Weekend :

    Weekends only.

Daily

Immediately

boolean

No

Specifies whether the run can be started immediately if the scheduled run time is in the future. Default value: false.

false

Alert

object

No

The alert configurations.

Type

string

No

The alert policy. Valid values:

  • Success: alerts on success.

  • Failure: alerts on failure.

  • SuccessFailure: alerts on both success and failure.

Valid values:

  • SuccessFailure :

    Alerts on both success and failure.

  • Failure :

    Alerts on failure.

  • Success :

    Alerts on success.

Succes

NoticeType

string

No

The notification method. Valid values:

  • Sms: text message only.

  • Mail: email only.

  • SmsMail: text message and email.

Valid values:

  • Mail :

    Email only.

  • Sms :

    Text message only.

  • SmsMail :

    Text message and email.

Sms

Parallelism

integer

No

The number of parallel tasks. A value from 2 to 10 indicates the parallelism. A value of 1 indicates serial execution. This parameter is required when Type is set to SupplementData.

2

Order

string

No

The run order. Default value: Asc. Valid values:

  • Asc: ascending order by business date.

  • Desc: descending order by business date.

Valid values:

  • Asc :

    Ascending order by business date.

  • Desc :

    Descending order by business date.

Asc

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

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 workflows and trigger-based workflows.

1

PriorityWeightStrategy

string

No

The priority weight policy. These parameter settings are supported only for manual workflows and trigger-based workflows. Valid values:

  • Disable: disabled. This is the default value.

  • Upstream: calculates the sum of the weights of the upstream nodes of the current node. A deeper hierarchy indicates a higher weight.

Valid values:

  • Upstream :

    By upstream weight.

  • Disable :

    Disabled.

Upstream

Comment

string

No

The reason for creation.

create for test

Tags

array<object>

No

The list of task tags.

object

No

Value

string

No

The tag value.

tagValue

Key

string

No

The tag key.

tagKey

TagCreationPolicy

string

No

The tag creation policy.

  • Append: Append mode. Inherits existing tags from the manual business process and appends new tags.

  • Overwrite: Overwrite mode. Does not inherit existing tags from the manual business process and directly creates tags.

Valid values:

  • Overwrite :

    Overwrite mode. Does not inherit existing tags from the manual business process and directly creates tags.

  • Append :

    Append mode. Inherits existing tags from the manual business process and appends new tags.

Append

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request. You can use this ID to locate logs and troubleshoot issues.

22C97E95-F023-56B5-8852-B1A77A17XXXX

OperationId

string

The operation ID. You can use this field to query the result of the creation operation by calling the GetCreateWorkflowInstancesResult API operation.

e15ad21c-b0e9-4792-8f55-b037xxxxxxxx

Examples

Success response

JSON format

{
  "RequestId": "22C97E95-F023-56B5-8852-B1A77A17XXXX",
  "OperationId": "e15ad21c-b0e9-4792-8f55-b037xxxxxxxx"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.