Updated on 2026-02-05 GMT+08:00

Querying the Workflow Version List

Function

This API is used to query the workflow version list.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/workspaces/{workspace_id}/soc/workflows/{workflow_id}/versions

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID, which is used to specify the project that a resource belongs to. You can query the resources of a project by project ID. You can obtain the project ID from the API or console. Obtaining the Project ID

Constraints

N/A

Range

N/A

Default Value

N/A

workspace_id

Yes

String

Definition

Workspace ID.

Range

N/A

workflow_id

Yes

String

Definition

Workflow ID.

Range

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

status

No

String

Definition

Workflow status.

  • pending_submit: draft

  • pending_approval: pending review

  • publishing: being published

  • publish_failed: publishing failed

  • not_activated: not activated

  • activated: activated

  • rejected: rejected

Range

  • pending_submit

  • pending_approval

  • publishing

  • publish_failed

  • not_activated

  • activated

  • rejected

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. You can obtain it by calling the IAM API for obtaining a user token. The user token is the value of X-Subject-Token in the response header. Obtaining a User Token

Constraints

N/A

Range

N/A

Default Value

N/A

Content-Type

Yes

String

Definition

Content type.

  • application/json;charset=UTF-8: common API request type

Constraints

N/A

Range

  • application/json;charset=UTF-8

Default Value

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

code

String

Definition

Error code.

Range

N/A

message

String

Definition

Error description.

Range

N/A

success

Boolean

Definition

Whether the request is successful.

Range

  • true: successful

  • false: failed

request_id

String

Definition

Request ID.

Constraints

N/A

total

Integer

Definition

Total data records.

Constraints

N/A

offset

Integer

Definition

Current page size.

Constraints

N/A

limit

Integer

Definition

Current page number.

Constraints

N/A

size

Integer

Definition

Current page size.

Constraints

N/A

page

Integer

Definition

Number of pages in a pagination query.

Constraints

N/A

data

Array of AopWorkflowVersionInfo objects

List object of workflow version details.

Table 5 AopWorkflowVersionInfo

Parameter

Type

Description

id

String

Definition

Workflow version ID.

Constraints

N/A

version_id

String

Definition

Workflow version ID.

Constraints

N/A

name

String

Definition

Workflow version name.

Constraints

N/A

aopworkflow_id

String

Definition

Workflow ID.

Constraints

N/A

description

String

Definition

Workflow version description.

Range

N/A

project_id

String

Definition

Tenant project ID.

Constraints

N/A

owner_id

String

Definition

Owner ID.

Constraints

N/A

creator_id

String

Definition

Creator ID.

Range

N/A

creator_name

String

Definition

Name of the creator.

Range

N/A

create_time

String

Definition

Creation time.

Range

N/A

modifier_id

String

Definition

ID of the updater.

Range

N/A

modifier_name

String

Definition

Name of the updater.

Range

N/A

update_time

String

Definition

Update time.

Range

N/A

enabled

Boolean

Definition

Enabled or not.

Constraints

N/A

Range

  • true: enabled

  • false: disabled

Default Value

false

status

String

Definition

Workflow status.

  • pending_submit: draft

  • pending_approval: pending review

  • publishing: being published

  • publish_failed: publishing failed

  • not_activated: not activated

  • activated: activated

  • rejected: rejected

Range

  • pending_submit

  • pending_approval

  • publishing

  • publish_failed

  • not_activated

  • activated

  • rejected

version

String

Definition

Version of the current workflow.

Constraints

N/A

Range

N/A

Default Value

N/A

taskconfig

String

Definition

Parameters of the workflow topology.

Constraints

N/A

Range

N/A

Default Value

N/A

taskflow

String

Definition

Base64 code of the workflow topology.

Constraints

N/A

Range

N/A

Default Value

N/A

taskflow_type

String

Definition

Workflow type.

Constraints

N/A

Range

  • JSON

Default Value

N/A

aop_type

String

Definition

Workflow type.

  • NORMAL: general

  • SURVEY: investigation

  • HEMOSTASIS: prevention

  • EASE: mitigation

Constraints

N/A

Range

  • NORMAL

  • SURVEY

  • HEMOSTASIS

  • EASE

Default Value

N/A

input

String

Definition

Workflow input.

Constraints

N/A

Range

N/A

Default Value

N/A

output

String

Definition

Workflow output.

Constraints

N/A

Range

N/A

Default Value

N/A

dataclass_id

String

Definition

Data class ID.

Range

N/A

dataclass_name

String

Definition

Data class name.

Range

N/A

workspace_id

String

Definition

Workspace ID.

Range

N/A

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

code

String

Definition

Error code.

Range

N/A

message

String

Definition

Error description.

Range

N/A

Example Requests

Query the workflow version list.

https://{endpoint}/v1/{project_id}/workspaces/{workspace_id}/soc/workflows/c19470f3-5eaf-4572-82e8-2ff094495919/versions

Example Responses

Status code: 200

Response to the request for querying the workflow version list.

{
  "code" : "00000000",
  "data" : [ {
    "aop_type" : "NORMAL",
    "aopworkflow_id" : "c19470f3-5eaf-4572-82e8-2ff094495919",
    "create_time" : "2025-07-18T14:47:17.000Z+0800",
    "creator_id" : "5857617f6b8b4981baef587c08ab8b68",
    "creator_name" : "XXXX",
    "dataclass_id" : "e410ae50-43fa-343e-807a-a2a9edb8018e",
    "dataclass_name" : "Alert",
    "description" : "Aop workflow description Test",
    "enabled" : null,
    "id" : "1a7677d4-0638-4cde-a2af-fe1460a883d4",
    "input" : "",
    "modifier_id" : "5857617f6b8b4981baef587c08ab8b68",
    "modifier_name" : "XXX",
    "name" : "Test_aop",
    "output" : "",
    "owner_id" : "",
    "project_id" : "f69081793d9e4ea8a2f479dcef961989",
    "status" : "pending_submit",
    "taskconfig" : "{\"trigger\":{\"advanced\":{\"retry_times\":0,\"retry_interval\":\"30\",\"log_level\":\"Info\"}},\"node_info\":{},\"usertask_info\":{}}",
    "taskflow" : "eyJlbGVtZW50VHlwZSI6Int9Iiwid29ya2Zsb3ciOnsiZWxlbWVudHMiOlt7InR5cGUiOiJlbGVtZW50IiwibmFtZSI6ImJwbW4yOmRlZmluaXRpb25zIiwiYXR0cmlidXRlcyI6eyJ4bWxuczp4c2kiOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIsInhtbG5zOmJwbW4yIjoiaHR0cDovL3d3dy5vbWcub3JnL3NwZWMvQlBNTi8yMDEwMDUyNC9NT0RFTCIsInhtbG5zOmJwbW5kaSI6Imh0dHA6Ly93d3cub21nLm9yZy9zcGVjL0JQTU4vMjAxMDA1MjQvREkiLCJ4bWxuczpkY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3VuZHMiLCJhdHRyaWJ1dGVzIjp7IngiOiI0MiIsInkiOiItOTgiLCJ3aWR0aCI6IjM2IiwiaGVpZ2h0IjoiMzYifX1dfSx7InR5cGUiOiJlbGVtZW50IiwibmFtZSI6ImJwbW5kaTpCUE1ORWRnZSIsImF0dHJpYnV0ZXMiOnsiaWQiOiJGbG93XzE0a25tZ25fZGkiLCJicG1uRWxlbWVudCI6IkZsb3dfMTRrbm1nbiJ9LCJlbGVtZW50cyI6W3sidHlwZSI6ImVsZW1lbnQiLCJuYW1lIjoiZGk6d2F5cG9pbnQiLCJhdHRyaWJ1dGVzIjp7IngiOiItMzAyIiwieSI6Ii04MCJ9fSx7InR5cGUiOiJlbGVtZW50IiwibmFtZSI6ImRpOndheXBvaW50IiwiYXR0cmlidXRlcyI6eyJ4IjoiNDIiLCJ5IjoiLTgwIn19XX1dfV19XX1dfX0=",
    "taskflow_type" : "JSON",
    "update_time" : "2025-07-18T14:53:03.000Z+0800",
    "version" : "",
    "version_id" : "1a7677d4-0638-4cde-a2af-fe1460a883d4",
    "workspace_id" : "f44065f5-557b-4376-ae02-8c65ef1960f4"
  } ],
  "message" : "",
  "page" : 0,
  "request_id" : "",
  "size" : 10,
  "success" : true,
  "total" : 1
}

SDK Sample Code

The SDK sample code is as follows.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.secmaster.v1.region.SecMasterRegion;
import com.huaweicloud.sdk.secmaster.v1.*;
import com.huaweicloud.sdk.secmaster.v1.model.*;


public class ListAopWorkflowVersionsSolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");
        String projectId = "{project_id}";

        ICredential auth = new BasicCredentials()
                .withProjectId(projectId)
                .withAk(ak)
                .withSk(sk);

        SecMasterClient client = SecMasterClient.newBuilder()
                .withCredential(auth)
                .withRegion(SecMasterRegion.valueOf("<YOUR REGION>"))
                .build();
        ListAopWorkflowVersionsRequest request = new ListAopWorkflowVersionsRequest();
        request.withWorkspaceId("{workspace_id}");
        request.withWorkflowId("{workflow_id}");
        try {
            ListAopWorkflowVersionsResponse response = client.listAopWorkflowVersions(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# coding: utf-8

import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdksecmaster.v1.region.secmaster_region import SecMasterRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdksecmaster.v1 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = os.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]
    projectId = "{project_id}"

    credentials = BasicCredentials(ak, sk, projectId)

    client = SecMasterClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(SecMasterRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ListAopWorkflowVersionsRequest()
        request.workspace_id = "{workspace_id}"
        request.workflow_id = "{workflow_id}"
        response = client.list_aop_workflow_versions(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    secmaster "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v1"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v1/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v1/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")
    projectId := "{project_id}"

    auth := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        WithProjectId(projectId).
        Build()

    client := secmaster.NewSecMasterClient(
        secmaster.SecMasterClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.ListAopWorkflowVersionsRequest{}
	request.WorkspaceId = "{workspace_id}"
	request.WorkflowId = "{workflow_id}"
	response, err := client.ListAopWorkflowVersions(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.

Status Codes

Status Code

Description

200

Response to the request for querying the workflow version list.

400

Abnormal response.

Error Codes

See Error Codes.