List Flow Instances¶
Search workflow instances that meet the search criteria.
Prerequisite¶
The user must be an EnOS user.
Request Format¶
POST https://{apigw-address}/batch-processing-service/v2.1/flowInstances
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Required/Optional |
Data Type |
Description |
|---|---|---|---|---|
userId |
Query |
Required |
String |
The user ID. How to get userId>> |
orgId |
Query |
Required |
String |
The organization ID which the user belongs to. How to get orgId>> |
action |
Query |
Required |
String |
Fixed value: search |
Request Parameters (Body)¶
Name |
Required/Optional |
Data Type |
Description |
|---|---|---|---|
type |
Required |
Integer |
The scheduling type of the workflow.
|
expression |
Optional |
String |
The search criteria, supporting fuzzy matching query for the |
owner |
Required |
String |
The username of the owner of the workflow instance. |
fromTriggerTime |
Required |
Long |
The starting trigger time range for the query. The workflow instances with a trigger time that falls between |
toTriggerTime |
Required |
Long |
The ending trigger time range for the query. The workflow instances with a trigger time that falls between |
status |
Required |
String |
The status of the flow instance. You can search for multiple status at the same time, separated by commas, such as status = “1,2,3”. For a description of the status, see FlowInstanceStatus |
pagination |
Required |
Pagination Struct |
Lists the paging requirements in a request. For more details, see Pagination Struct |
FlowInstanceStatus¶
Status |
Description |
|---|---|
-1 |
FAIL |
0 |
INIT |
1 |
SUCCESS |
2 |
RUNNING |
3 |
SUSPEND |
4 |
INTERNAL_ERROR |
5 |
WAIT |
6 |
READY |
7 |
TIMEOUT |
8 |
CANCEL |
9 |
RERUN |
10 |
SKIP |
Pagination Struct¶
Sample¶
{
"pagination": {
"pageNo": 0,
"pageSize": 10,
"sorters": [{
"field": "start_time",
"order": "ASC"
}]
}
}
Parameters¶
Name |
Required/Optional |
Data Type |
Description |
|---|---|---|---|
pageNo |
Required |
Integer |
The request pages, starting from 1. |
pageSize |
Required |
Integer |
The number of records in each page, which must be greater than 0. For optimal performance, it is recommended to have not more than 50 records per page. |
sorters |
Optional. |
jsonArray |
The pagination sorting method.(The sorters struct contains two fields: sorter.field and sorter.order, see the sorters parameter below for details.) |
sorters¶
Name |
Required/Optional |
Data Type |
Description |
|---|---|---|---|
field |
Required |
String |
The pagination field name. Supported fields are: create_time, update_time, start_time, trigger_time, end_time. |
order |
Optional |
String |
|
Response Parameters¶
Name |
Data Type |
Description |
|---|---|---|
data |
FlowInstances Struct |
The number and details of the searched workflow instances. For more information, see FlowInstances Struct |
Response Parameters¶
Name |
Data Type |
Description |
|---|---|---|
data |
FlowInstances Struct |
The number and details of the searched workflow instances. For more information, see FlowInstances Struct |
FlowInstances Struct¶
Sample¶
{
"flowInsts":[],
"count":0
}
Parameters¶
Name |
Data Type |
Description |
|---|---|---|
flowInsts |
Array of FlowInstance Structs |
The list of workflow instances. For more information, see FlowInstance Struct |
count |
Integer |
The number of searched workflow instances (number of elements in the FlowInstance struct). |
Error Code¶
Code |
Message |
Description |
|---|---|---|
62102 |
The sorters field parameter is invalid |
The given
|
For other error codes, see Common Error Codes.
Samples¶
Request Sample¶
url: https://{apigw-address}/batch-processing-service/v2.1/flowInstances?action=search&userId=yourUserId&orgId=yourOrgId
method: POST
requestBody:
{
"type": 1,
"fromTriggerTime": 1672502400000,
"toTriggerTime": 1672588800000,
"status": "1,-1",
"owner": "",
"expression": "",
"pagination":{
"pageNo": 1,
"pageSize": 10,
"sorters": [{
"field": "update_time",
"order": "ASC"
}]
}
}
Return Sample¶
{
"code": 0,
"msg": "OK",
"data": {
"flowInsts": [
{
"instanceId": "FLOW_001-20230101000000",
"flowId": 1001,
"flowName": "data_processing",
"freq": "0 0 0 * * ? *",
"cycle": "D",
"parameters": "[]",
"doAs": "system_executor",
"graph": "{\"creator\":\"admin\",\"freq\":\"0 0 0 * * ? *\",\"alertMode\":1,\"owners\":\"dev_team\",\"cycle\":\"D\",\"doAs\":\"executor\",\"flows\":[],\"name\":\"data_processing\",\"instId\":\"FLOW_001-20230101000000\",\"id\":1001,\"relations\":[],\"parameters\":\"[]\",\"tasks\":[{\"taskName\":\"data_task\",\"taskInstId\":\"TASK_001-20230101000000\",\"x\":0.01,\"y\":0.01,\"taskId\":1001,\"nodeId\":\"t_1001\"}]}",
"status": 1,
"statusDesc": "SUCCESS",
"triggerTime": "2023-01-01 00:00:00",
"startTime": "2023-01-01 00:00:01",
"endTime": "2023-01-01 00:00:03",
"timestamp": "2023-01-01 00:00:05.0",
"virtual": false,
"owner": "dev_team",
"hasEditPri": true,
"hasReadPri": true,
"isCancelled": false
},
{
"instanceId": "FLOW_002-20230101000000",
"flowId": 1002,
"flowName": "file_operation",
"freq": "0 0 0 * * ? *",
"cycle": "D",
"parameters": "[]",
"doAs": "system_executor",
"graph": "{\"creator\":\"admin\",\"freq\":\"0 0 0 * * ? *\",\"alertMode\":1,\"owners\":\"dev_team\",\"cycle\":\"D\",\"doAs\":\"executor\",\"flows\":[],\"name\":\"file_operation\",\"instId\":\"FLOW_002-20230101000000\",\"id\":1002,\"relations\":[],\"parameters\":\"[]\",\"tasks\":[{\"taskName\":\"file_task\",\"taskInstId\":\"TASK_002-20230101000000\",\"x\":0.02,\"y\":0.02,\"taskId\":1002,\"nodeId\":\"t_1002\"}]}",
"status": 1,
"statusDesc": "SUCCESS",
"triggerTime": "2023-01-01 00:01:00",
"startTime": "2023-01-01 00:01:01",
"endTime": "2023-01-01 00:01:03",
"timestamp": "2023-01-01 00:01:05.0",
"virtual": false,
"owner": "dev_team",
"hasEditPri": true,
"hasReadPri": true,
"isCancelled": false
}
],
"count": 2
}
}