All Products
Search
Document Center

DataWorks:ImportWorkflowDefinition

Last Updated:Dec 05, 2024

Imports a workflow and its child nodes that are specified by the FlowSpec field to DataStudio.

Operation description

Note You cannot use this API operation to import multiple workflows at a time. If you specify multiple workflows by using FlowSpec, the system imports only the first specified workflow.
Note ImportWorkflowDefinition is an asynchronous operation. After you send a request, an asynchronous task is generated, and the system returns the ID of the asynchronous task. You can call the GetJobStatus operation to query the status of the asynchronous task.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ProjectIdstringYes

The DataWorks workspace ID. You can log on to the DataWorks console and go to the Workspace page to query the ID.

You must configure this parameter to specify the DataWorks workspace to which the API operation is applied.

123456
SpecstringYes

The FlowSpec field information about the workflow. For more information, see FlowSpec .

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

7C352CB7-CD88-50CF-9D0D-E81BDF020E7F
AsyncJobobject

The status information of the asynchronous task.

Completedboolean

Indicates whether the asynchronous task is complete.

false
CreateTimelong

The time when the asynchronous task was created. This value is a UNIX timestamp.

1706581425000
Errorstring

The error message returned if the asynchronous task fails.

target folder already exists: XXXX
Idstring

The ID of the asynchronous task.

1234567691239009XXXX
Progressinteger

The progress of the asynchronous task. Valid values: 0 to 100.

0
Responsestring

The response.

Note The workflow ID is returned.
632647691239009XXXX
Statusstring

The status of the asynchronous task.

Valid values:

  • Running: The asynchronous task is running.
  • Success: The asynchronous task is complete.
  • Fail: The asynchronous task fails.
  • Cancel: The asynchronous task is canceled.
Running
Typestring

The type of the asynchronous task.

Valid values:

  • Create: The asynchronous task is used to create an object.
  • Cancel: The asynchronous task is used to cancel an operation.
Create

Examples

Sample success responses

JSONformat

{
  "RequestId": "7C352CB7-CD88-50CF-9D0D-E81BDF020E7F",
  "AsyncJob": {
    "Completed": false,
    "CreateTime": 1706581425000,
    "Error": "target folder already exists: XXXX",
    "Id": "1234567691239009XXXX",
    "Progress": 0,
    "Response": "632647691239009XXXX",
    "Status": "Running",
    "Type": "Create"
  }
}

Error codes

For a list of error codes, visit the Service error codes.