Help Center> Object Storage Service> API Reference> APIs> Data+> Querying the Workflow Instance List

Querying the Workflow Instance List

Functions

Queries a user's workflow instance list.

Request Syntax

GET /v2/workflowexecutions?x-workflow-next-marker={marker}&x-workflow-limit={limit}&x-workflow-graph-name={graph_name}&x-workflow-execution-type={execution_type} HTTP/1.1
Host: obs.cn-north-4.myhuaweicloud.com 
Authorization: authorization
Content-Type: application/json
Content-Length: length
Date: date

Request parameters

Table 1 Parameters

Parameter

Mandatory

Type

Description

Constraints

x-workflow-execution-type

No

String

Execution type of a workflow instance

It can be set to one of the following enumerated values:

  • APICALL: Queries the list of workflow instances that are triggered by APIs.
  • TRIGGERCAL: Queries the list of workflow instances that are triggered by events.

x-workflow-next-marker

No

String

Specifies an identifier when listing workflow instances. The returned workflow instance list contains all workflow instances after the specified identifier in alphabetical order.

The identifier consists of two parts:

Trigger type + Workflow instance name. For details about the enumerated values of the trigger type, see the constraints of the x-workflow-execution-type field.

x-workflow-limit

No

Int

Maximum number of records returned for a request.

The value ranges from 1 to 1000. If this parameter is not specified, the default value 10 is used.

x-workflow-graph-name

Yes

string

Workflow name

The workflow must be an existing one.

Request Headers

This request uses common headers. For details, see Table 3.

Request Elements

This request contains no message parameters.

Response Syntax

HTTP/1.1 status_code 
Date: date 
Content-Length: length 
Content-Type: type
X-Request-ID: obs request id

json body

Response Headers

The response to the request uses common headers. For details, see Table 1.

Response Elements

Table 2 Response elements

Parameter

Type

Description

count

Int

Number of running instances that meet the conditions.

executions

Array Execution

Instance information list.

is_truncated

Boolean

Indicates whether the returned list is truncated.

  • true: Not all results are returned.
  • false: All results are returned.

next_marker

String

If not all results are returned, the response contains this field, marking the last workflow instance listed in the request. In subsequent requests, you can set Marker to the value of this parameter to list the remaining workflow instances.

If is_truncated is set to false, this field is not returned.

Table 3 Execution information table

Parameter

Type

Description

graph_urn

String

Workflow URN

execution_urn

String

Workflow instance URN.

started_at

String

Start time of a workflow instance.

execution_type

String

Workflow execution mode.

stopped_at

String

Workflow stop time.

execution_state

String

Workflow running status.

execution_name

String

Workflow name

Error Responses

No special error responses are returned. For details about error responses, see Table 2.

Sample Request

GET /v2/workflowexecutions?x-workflow-next-marker={marker}&x-workflow-limit={limit}&x-workflow-graph-name={graph_name}&x-workflow-execution-type={execution_type} HTTP/1.1
Host: obs.cn-north-4.myhuaweicloud.com 
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:sc2PM13Wlfcoc/YZLK0MwsI2Zpo=
Content-Type: application/json
Content-Length: 0
Date: Thu, 27 Aug 2020 12:38:10 GMT

Sample Response

HTTP/1.1 200 OK 
Date: Thu, 27 Aug 2020 12:38:10 GMT 
Content-Length: 100 
Content-Type: application/json
X-Request-ID: 6a63a18b8bab40ffb71ebd9cb80d0085
{
    "count": 1,
    "is_truncated": true,
    "next_marker": "TRIGGERCALaa76d0ccc918619a2853ce2c5965c592ca6d8dfa1c39635029dacea2",
    "executions": [{
        "graph_urn": "urn:fgs:<region_id>:<project_id>:graph:<graph_name>",
        "execution_urn": "urn:fgs:<region_id>:<project_id>:execution:<graph_name>:<execution_name>:<domain_id>",
        "started_at": "2020-04-23T13:37:43.847Z",
        "execution_type": "APICALL",
        "stopped_at": "",
        "execution_state": "RUNNING",
        "execution_name": "<execution_name>"
    }]
}