Help Center/ FunctionGraph/ API Reference/ APIs/ Function Flows/ Querying Records of a Flow in Pagination Mode
Updated on 2024-01-12 GMT+08:00

Querying Records of a Flow in Pagination Mode

Function

This API is used to query the records of a flow in pagination mode.

URI

GET /v2/{project_id}/fgs/workflows/{workflow_id}/executions-history

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID.

Minimum: 1

Maximum: 64

workflow_id

Yes

String

Flow ID.

Minimum: 1

Maximum: 512

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

Yes

Integer

Offset, which is the position where the query starts. The value must be greater than or equal to 0.

Minimum: 0

limit

Yes

Integer

Number of data records that can be displayed on each page in pagination query. Options: 1 to 100.

Minimum: 1

Maximum: 100

start_time

No

String

Start time in the format of YYYY-MM-DD hh:mm:ss (UTC time). If the start time is not specified, it is three days earlier than the end time.

end_time

No

String

End time in the format of YYYY-MM-DD hh:mm:ss (UTC time). If the end time is not specified, it is three days later than the start time. If neither of them is set, data of the last three days is queried by default.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

executions

Array of FlowExecutionBrief objects

Flow execution information.

Array Length: 0 - 999

total

Long

Total number of records.

size

Integer

Number of records on each page.

Table 4 FlowExecutionBrief

Parameter

Type

Description

workflow_id

String

Flow ID.

Minimum: 1

Maximum: 64

workflow_urn

String

Flow URN. Format:urn:fss:<region_id>:<project_id>:workflow:<package>:<workflow_name>:<version>Currently, package and version can only be set to default and latest, respectively.

execution_id

String

Flow instance ID.

Minimum: 1

Maximum: 64

status

String

Flow instance execution status.

Minimum: 1

Maximum: 32

Enumeration values:

  • success

  • fail

  • running

  • timeout

  • cancel

begin_time

String

Flow instance creation time (UTC), in the format yyyy-MM-ddTHH:mm:ssZ.

Minimum: 0

Maximum: 64

end_time

String

Flow instance end time (UTC), in the format yyyy-MM-ddTHH:mm:ssZ.

Minimum: 0

Maximum: 64

last_update_time

String

Flow instance last update time (UTC), in the format yyyy-MM-ddTHH:mm:ssZ.

Minimum: 0

Maximum: 64

created_by

String

Flow instance creator.

Minimum: 1

Maximum: 32

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 1

Maximum: 36

error_msg

String

Error description.

Minimum: 2

Maximum: 512

request_id

String

Request ID.

Minimum: 2

Maximum: 512

Status code: 500

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 1

Maximum: 36

error_msg

String

Error description.

Minimum: 2

Maximum: 512

request_id

String

Request ID.

Minimum: 2

Maximum: 512

Example Requests

Query the instances of function flow {workflow_id} in pagination mode.

GET /v2/{project_id}/fgs/workflows/{workflow_id}/executions-history

Example Responses

Status code: 200

Response to flow query.

{
  "executions" : [ {
    "workflow_id" : "c0aecc37-8b78-4fc5-81af-14af495dc053",
    "execution_id" : "41c25eec-a1ba-4789-9851-eaead00cd6b9",
    "status" : "success",
    "begin_time" : "2022-10-11T06:30:45Z",
    "end_time" : "2022-10-11T06:30:47Z",
    "last_update_time" : "2022-10-11T06:30:45Z",
    "created_by" : "c0aecc37-8b78-4fc5-81af-14af495dc053",
    "workflow_urn" : "urn:fss:cn-north-7:c53626012ba84727b938ca8bf03108ef:workflow:default:flow_nxy_tp:latest"
  }, {
    "workflow_id" : "c0aecc37-8b78-4fc5-81af-14af495dc053",
    "execution_id" : "74a29a25-2d6d-4b50-a02e-63b7c5b8ab93",
    "status" : "success",
    "begin_time" : "2022-10-11T06:30:24Z",
    "end_time" : "2022-10-11T06:30:26Z",
    "last_update_time" : "2022-10-11T06:30:25Z",
    "created_by" : "c0aecc37-8b78-4fc5-81af-14af495dc053",
    "workflow_urn" : "urn:fss:cn-north-7:c53626012ba84727b938ca8bf03108ef:workflow:default:flow_nxy_tp:latest"
  } ],
  "total" : 100,
  "size" : 10
}

Status Codes

Status Code

Description

200

Response to flow query.

400

Bad Request

500

Internal Server Error

Error Codes

See Error Codes.