Querying the Details of a Workflow Instance
Function
This API is used to query the details of a workflow instance.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/workspaces/{workspace_id}/soc/workflows/instances/{instance_id}
|
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 |
|
instance_id |
Yes |
String |
Definition Workflow instance ID. Constraints 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 |
|---|---|---|
|
id |
String |
Definition Workflow instance ID. Constraints N/A |
|
name |
String |
Definition Workflow instance name. Constraints N/A |
|
workflow |
workflow object |
Workflow object. |
|
dataclass |
dataclass object |
Data class object. |
|
playbook |
playbook object |
Playbook object. |
|
trigger_type |
String |
Definition Trigger method. Range |
|
status |
String |
Definition Workflow instance status. Range |
|
start_time |
String |
Definition Start time. Constraints N/A |
|
end_time |
String |
Definition End time. Constraints N/A |
|
retry_count |
Integer |
Definition Number of workflow instance retries. Constraints N/A |
|
defense_id |
String |
Definition Defense layer ID. Constraints N/A |
|
dataobject_id |
String |
Definition Data object ID. Constraints N/A |
|
topology |
WorkflowInstanceTopology object |
Definition Workflow instance topology information. Constraints N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition Workflow ID. Constraints N/A |
|
name |
String |
Definition Workflow name in Chinese. Constraints N/A |
|
name_en |
String |
Definition Workflow name in English. Constraints N/A |
|
version |
String |
Definition Workflow version. Constraints N/A |
|
version_id |
String |
Definition Workflow version ID. Constraints N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
en_name |
String |
Definition Data class name in English. Constraints N/A |
|
id |
String |
Definition Data class ID. Constraints N/A |
|
name |
String |
Definition Data class name in Chinese. Constraints N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
en_name |
String |
Definition Playbook name in English. Constraints N/A |
|
id |
String |
Definition Playbook ID. Constraints N/A |
|
name |
String |
Definition Playbook name. Constraints N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
audit_logs |
Array of TopologyNodeInfo objects |
Definition Topology node information. Constraints N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
instance_type |
String |
Definition Node instance type of the workflow topology. Range |
|
action_id |
String |
Definition Node ID of the workflow topology. Range N/A |
|
action_name |
String |
Definition Node name of the workflow topology. Range N/A |
|
start_time |
String |
Definition Node start time of the workflow topology. Range |
|
end_time |
String |
Definition Node end time of the workflow topology. Range |
|
error_msg |
String |
Definition Node error information of the workflow topology. Range |
|
input |
String |
Definition Node input information of the workflow topology. Range |
|
output |
String |
Definition Node output information of the workflow topology. Range |
|
parent_instance_id |
String |
Definition Parent instance ID of the workflow topology. Range |
|
status |
String |
Definition Node status of the workflow topology. Range |
|
succeed |
Boolean |
Definition Whether the node in the workflow topology is successful. Range |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
code |
String |
Definition Error code. Range N/A |
|
message |
String |
Definition Error description. Range N/A |
Example Requests
None
Example Responses
Status code: 200
Response to the request for querying the workflow instance details.
{
"dataclass" : {
"id" : "e410ae50-43fa-343e-807a-a2a9edb8018e",
"name" : "Alert"
},
"dataobject_id" : "2462e8c3-e393-4af9-93b6-fe424c0b4e39",
"defense_id" : "",
"end_time" : "2025-07-18T15:11:04.577Z+0800",
"id" : "8eed56de-7aaf-4732-baaf-46c1bb11dc8f",
"name" : "ZFGJZDGB-20250718151103",
"playbook" : {
"id" : "3e966553-f53d-3d87-835e-7697e353876a",
"name" : "Automatic closing of repeated alerts"
},
"retry_count" : 0,
"start_time" : "2025-07-18T15:11:03.000Z+0800",
"status" : "FINISHED",
"trigger_type" : "EVENT",
"workflow" : {
"id" : "4a6fe02f-b4b4-3b5f-8a11-6f22229e18db",
"name" : "Automatic closing of repeated alerts",
"version" : "v1",
"version_id" : "9f436a38-5c82-312b-aaba-b91a48e99086"
}
}
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 ShowAopWorkflowInstanceSolution { 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(); ShowAopWorkflowInstanceRequest request = new ShowAopWorkflowInstanceRequest(); request.withWorkspaceId("{workspace_id}"); request.withInstanceId("{instance_id}"); try { ShowAopWorkflowInstanceResponse response = client.showAopWorkflowInstance(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 = ShowAopWorkflowInstanceRequest() request.workspace_id = "{workspace_id}" request.instance_id = "{instance_id}" response = client.show_aop_workflow_instance(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.ShowAopWorkflowInstanceRequest{} request.WorkspaceId = "{workspace_id}" request.InstanceId = "{instance_id}" response, err := client.ShowAopWorkflowInstance(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 instance details. |
|
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