Updated on 2024-01-12 GMT+08:00

Querying a Flow Instance

Function

This API is used to query an instance of a flow.

URI

GET /v2/{project_id}/fgs/workflows/{workflow_id}/executions/{execution_id}

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

execution_id

Yes

String

Flow instance ID.

Minimum: 1

Maximum: 64

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Get-Workflow-Full-History-Data

No

Boolean

Whether to obtain the complete flow execution output.

Response Parameters

Status code: 200

Table 3 Response body parameters

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

headers

Object

Headers for function execution.

input

Object

Input parameters for function execution.

output

Object

Function execution result.

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

node_execution_details

Array of NodeExecutionDetail objects

Node execution information.

Array Length: 0 - 200

Table 4 NodeExecutionDetail

Parameter

Type

Description

node_id

String

Flow node ID.

Minimum: 1

Maximum: 64

node_name

String

Flow node name.

execution_id

String

Flow node execution record ID.

executions

Array of NodeExecution objects

Node execution records.

Array Length: 0 - 200

Table 5 NodeExecution

Parameter

Type

Description

status

String

Flow node execution status.

Minimum: 1

Maximum: 32

Enumeration values:

  • success

  • fail

  • running

  • timeout

  • cancel

input

Object

Input parameters for function execution.

output

Object

Function execution result.

begin_time

Long

Node start time (UTC), precise to milliseconds.

Minimum: 0

Maximum: 99999999999999999

end_time

Long

Node end time (UTC), precise to milliseconds.

Minimum: 0

Maximum: 99999999999999999

error_message

Object

Error message. This parameter has a value only when the node execution fails.

request_id

String

Flow node request ID.

Status code: 400

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

Status code: 404

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 1

Maximum: 36

error_msg

String

Error description.

Minimum: 2

Maximum: 512

Status code: 500

Table 8 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 details about instance {execution_id} of function flow {workflow_id}.

GET /v2/{project_id}/fgs/workflows/{workflow_id}/executions/{execution_id}

Example Responses

Status code: 200

OK

{
  "workflow_id" : "48aff955-ea10-4ffd-b426-190bc192dc14",
  "workflow_urn" : "urn:fss:cn-north-7:73d69ae0cfcf460190522d060f05ad:workflow:default:testflow:latest",
  "execution_id" : "48aff955-ea10-4ffd-b426-190bc192dc14",
  "status" : "running",
  "headers" : {
    "tenantId" : "user1"
  },
  "input" : {
    "arg1" : "argument_1",
    "arg2" : "argument_2"
  },
  "output" : {
    "arg1" : "argument_1",
    "arg2" : "argument_2"
  },
  "begin_time" : "2021-01-01T00:00:00Z",
  "end_time" : "2021-01-01T00:00:00Z",
  "last_update_time" : "2021-01-01T00:00:00Z",
  "created_by" : "admin",
  "node_execution_details" : [ {
    "node_id" : "48aff955-ea10-4ffd-b426-190bc192dc14",
    "node_name" : "string",
    "execution_id" : "string",
    "executions" : [ {
      "status" : "running",
      "input" : {
        "arg1" : "argument_1",
        "arg2" : "argument_2"
      },
      "output" : {
        "arg1" : "argument_1",
        "arg2" : "argument_2"
      },
      "begin_time" : 1605119892050,
      "end_time" : 1605119892050,
      "error_message" : {
        "detail:\"Execution failed\"" : null
      },
      "request_id" : "string"
    } ]
  } ]
}

Status Codes

Status Code

Description

200

OK

400

Bad Request

404

Bad Request

500

Internal Server Error

Error Codes

See Error Codes.