Querying the Workflow List
Function
This API is used to query the workflow list.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/workspaces/{workspace_id}/soc/workflows
|
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 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
offset |
No |
Integer |
Definition Offset. Constraints 0 to 10,000 Range N/A Default Value 0 |
|
limit |
No |
Integer |
Definition Data volume. Constraints 1 to 100 Range N/A Default Value 10 |
|
order |
No |
String |
Definition Sorting order.
Constraints N/A Range
Default Value DESC |
|
sortby |
No |
String |
Definition Sorting field.
Constraints N/A Range
Default Value
|
|
enabled |
No |
Boolean |
Definition Enabled or not. Constraints N/A Range
Default Value N/A |
|
name |
No |
String |
Definition Workflow name. Constraints N/A Range N/A Default Value N/A |
|
description |
No |
String |
Definition Workflow description. Constraints N/A Range N/A Default Value N/A |
|
dataclass_id |
No |
String |
Definition Data class ID. Constraints N/A Range N/A Default Value N/A |
|
dataclass_name |
No |
String |
Definition Data class name. Constraints N/A Range N/A Default Value N/A |
|
aop_type |
No |
String |
Definition Workflow type.
Constraints N/A Range
Default Value N/A |
Request 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.
Constraints N/A Range
Default Value N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
X-request-id |
String |
Request ID. Format: request_uuid-timestamp-hostname. |
|
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
|
|
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 AopWorkflowInfo objects |
Definition Workflow list. Range N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition Workflow ID. Range N/A |
|
name |
String |
Definition Workflow name. Range N/A |
|
description |
String |
Definition Workflow description. Range N/A |
|
project_id |
String |
Definition Tenant ID. Range N/A |
|
owner_id |
String |
Definition Owner ID. Range 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 |
|
edit_role |
String |
Definition Editing a Role Range N/A |
|
use_role |
String |
Definition User role. Range N/A |
|
approve_role |
String |
Definition Review role. Range N/A |
|
enabled |
Boolean |
Definition Enabled or not. Range
|
|
workspace_id |
String |
Definition Workspace ID. Range N/A |
|
version_id |
String |
Definition ID of the activated workflow version. Range N/A |
|
current_approval_version_id |
String |
Definition ID of the version to be reviewed. Range N/A |
|
current_rejected_version_id |
String |
Definition ID of the rejected version. Range N/A |
|
aop_type |
String |
Definition Workflow type.
Range
|
|
engine_type |
String |
Definition Engine type.
Range
|
|
dataclass_id |
String |
Definition Data class ID. Range N/A |
|
dataclass_name |
String |
Definition Data class name. Range N/A |
|
labels |
String |
Definition Workflow entity type.
Range
|
|
version |
String |
Definition Version of the activated workflow. Range N/A |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
X-request-id |
String |
Request ID. Format: request_uuid-timestamp-hostname. |
|
Parameter |
Type |
Description |
|---|---|---|
|
code |
String |
Definition Error code. Range N/A |
|
message |
String |
Definition Error description. Range N/A |
Example Requests
Query the workflow list. Offset: 0. Quantity: 10.
https://{endpoint}/v1/{project_id}/workspaces/{workspace_id}/soc/workflows?offset=0&limit=10
Example Responses
Status code: 200
Response to the request for querying the workflow list.
{
"code" : "00000000",
"data" : [ {
"aop_type" : "NORMAL",
"approve_role" : "",
"create_time" : "2025-07-18T11:28:27.000Z+0800",
"creator_id" : "5857617f6b8b4981baef587c08ab8b68",
"creator_name" : "XXX",
"current_approval_version_id" : "",
"current_rejected_version_id" : "",
"dataclass_id" : "e410ae50-43fa-343e-807a-a2a9edb8018e",
"dataclass_name" : "Alert",
"description" : "desc",
"edit_role" : "",
"enabled" : false,
"engine_type" : "public_engine",
"id" : "89262e34-4e5f-4cb2-9308-0b30e3d6e778",
"labels" : "IP",
"modifier_id" : "",
"modifier_name" : "",
"name" : "test001",
"owner_id" : "",
"project_id" : "f69081793d9e4ea8a2f479dcef961989",
"update_time" : "2025-07-18T11:28:27.000Z+0800",
"use_role" : "",
"version" : "",
"version_id" : "",
"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.
Java
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 |
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.v2.region.SecMasterRegion; import com.huaweicloud.sdk.secmaster.v2.*; import com.huaweicloud.sdk.secmaster.v2.model.*; public class ListWorkflowsSolution { 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(); ListWorkflowsRequest request = new ListWorkflowsRequest(); request.withWorkspaceId("{workspace_id}"); try { ListWorkflowsResponse response = client.listWorkflows(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()); } } } |
Python
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 |
# coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdksecmaster.v2.region.secmaster_region import SecMasterRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdksecmaster.v2 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 = ListWorkflowsRequest() request.workspace_id = "{workspace_id}" response = client.list_workflows(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg) |
Go
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 |
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" secmaster "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/secmaster/v2/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.ListWorkflowsRequest{} request.WorkspaceId = "{workspace_id}" response, err := client.ListWorkflows(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } } |
More
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 list. |
|
400 |
Abnormal response. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot