Get Flow Instance¶
Get the information of a specified workflow instance.
Prerequisite¶
The user must be an EnOS user.
Request Format¶
GET https://{apigw-address}/batch-processing-service/v2.1/flowInstances
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Required/Optional |
Data Type |
Description |
|---|---|---|---|---|
flowInstId |
Query |
Required |
String |
The ID of the workflow instance. |
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: get |
Response Parameters¶
FlowInstance Struct¶
Sample¶
{
"instanceId": "2438-201907261239",
"flowId": 2438,
"flowName": "rew",
"freq": "0 1/1 * * * ? *",
"cycle": "mi",
"parameters": "[]",
"doAs": "your_bd_account",
"graph": "{\"creator\":\"yourCreator\",\"freq\":\"0 1/1 * * * ? *\",\"alertMode\":3,\"owners\":\"yourOwners\",\"cycle\":\"mi\",\"do_as\":\"yourDoAs\",\"flows\":[],\"name\":\"rew\",\"instId\":\"2438-201907261239\",\"id\":2438,\"relations\":[],\"parameters\":\"[]\",\"tasks\":[{\"taskName\":\"fr\",\"taskInstId\":\"104452-201907261239\",\"x\":0.0198,\"y\":0.0045,\"taskId\":104452,\"nodeId\":\"t_104452\",\"status\":\"SUCCESS\"}]}",
"status": 0,
"statusDesc": "INIT",
"triggerTime": "2019-07-26 20:39:00",
"startTime": "2019-07-26 12:39:37",
"endTime": "2019-07-26 12:39:42",
"timestamp": "2019-07-26 12:38:30.0",
"virtual": false,
"owner": "yourOwners",
"alertMode": 3,
"calDt": "2019-07-25",
"hasEditPri": false,
"hasReadPri": true
}
Parameters¶
Name |
Data Type |
Description |
|---|---|---|
instanceId |
String |
The ID of the workflow instance. |
flowId |
Integer |
The workflow ID. |
flowName |
String |
The workflow name. |
freq |
String |
Workflow scheduling cycle using 7-field Crontab format.
|
cycle |
String |
The scheduling cycle.
|
parameters |
List<Map<key,value>> |
Scheduling parameters. As globally configured parameters, they can be used within nodes to dynamically adapt the task runtime to environmental changes (parameters must be expressed in |
doAs |
String |
The big data account of the organization to which the workflow belongs. |
graph |
InstanceGraph Struct |
The task dependency of the workflow instance. For more information, see InstanceGraph Struct |
status |
Integer |
The task running status. |
statusDesc |
String |
The description of the task running status. |
triggerTime |
String |
The planned triggering time of the task. |
startTime |
String |
The start time of the task. |
endTime |
String |
The end time of the task. |
timestamp |
String |
The time when the instance was created. |
virtual |
Boolean |
|
owner |
String |
The owner of the workflow instance. |
alertMode |
Integer |
The alert mode.
|
calDt |
String |
The business date (date from which the data starts to be processed by the workflow). |
hasEditPri |
Boolean |
|
hasReadPri |
Boolean |
|
InstanceGraph Struct¶
Sample¶
{
"creator":"creator_id",
"freq":"0 0 0 * * ? *",
"alertMode":3,
"owners":"owner_id",
"cycle":"D",
"doAs":"your_bd_account",
"flows":[],
"name":"21",
"instId":"2809-20190812080700",
"id":2809,
"relations":[],
"parameters":"[]",
"tasks":
[{
"taskName":"tass",
"taskInstId":"104890-20190812080700",
"x":0.002,
"y":0.002,
"taskId":104890,
"nodeId":"t_104890",
"status":"CANCEL"}]
}
Parameters¶
Name |
Data Type |
Description |
|---|---|---|
creator |
String |
The username of the user who created the workflow instance. |
freq |
String |
Workflow scheduling cycle using 7-field Crontab format.
|
alertMode |
Integer |
The alert mode.
|
owners |
String |
The username of the owners of the workflow. The semicolon (;) is used to separate each owner, for example, owners=”userNameA;userNameB”. |
cycle |
String |
The scheduling cycle.
|
doAs |
String |
The big data account of the organization to which the workflow belongs. |
flows |
Array of FlowInstanceGraph Struct |
The workflow dependency of the workflow instance. For more information, see FlowInstanceGraph Struct |
name |
String |
The workflow name. |
instId |
Integer |
The ID of the workflow instance. |
id |
Integer |
The workflow ID. |
relations |
Array of Relation Structs |
The list of relations between tasks in the workflow, with each element representing the upstream and downstream dependency. For more information, see Relation Struct |
parameters |
List<Map<key,value>> |
Scheduling parameters. As globally configured parameters, they can be used within nodes to dynamically adapt the task runtime to environmental changes (parameters must be expressed in |
tasks |
Array of TaskInstanceGraph Structs |
The list of all task instances in the workflow instance. For more information, see TaskInstanceGraph Struct |
FlowInstanceGraph Struct¶
Sample¶
{
"flowId": "FLOW_001",
"flowName": "sample_workflow",
"nodeId": "node_FLOW_001",
"isVirtual": false,
"x": 0.0125,
"y": 0.0125,
"flowInstId": "FLOW_001-20230101000000",
"status": "NONE"
}
Parameters¶
Name |
Data Type |
Description |
|---|---|---|
flowId |
String |
The workflow ID. |
flowName |
String |
The workflow name. |
nodeId |
String |
The ID of the node that is part of other workflows. |
isVirtual |
Boolean |
|
x |
Double |
The x-axis of the node on the configuration panel of the workflow. |
y |
Double |
The y-axis of the node on the configuration panel of the workflow. |
flowInstId |
String |
The ID of the workflow instance. |
TaskInstanceGraph Struct¶
Sample¶
{
"taskName": "sample_task",
"taskInstId": "TASK_001-20230101000000",
"x": 0.0132,
"y": 0.008100000381469727,
"taskId": "TASK_001",
"nodeId": "node_TASK_001",
"status": "INIT"
}
Parameters¶
Name |
Data Type |
Description |
|---|---|---|
taskName |
String |
The task name. |
taskInstId |
String |
The ID of the task instance. |
x |
Double |
The x-axis of the task on the configuration panel. |
y |
Double |
The y-axis of the task on the configuration panel. |
taskId |
String |
The task ID. |
nodeId |
String |
The node ID (Note: The node ID is not the same as the task ID, because there are task nodes and workflow nodes that have dependency relations in a workflow). |
status |
String |
The status of the task instance. |
Error Code¶
See Common Error Codes.
Samples¶
Request Sample¶
url: https://{apigw-address}/batch-processing-service/v2.1/flowInstances?action=get&flowInstId=2809-20190808093200&userId=yourUserId&orgId=yourOrgId
method: GET
Return Sample¶
{
"code": 0,
"msg": "OK",
"data": {
"instanceId": "FLOW_001-20230101000000",
"flowId": 1001,
"flowName": "sample_workflow",
"freq": "0 0 0 * * ? *",
"cycle": "D",
"parameters": "[]",
"doAs": "service_account",
"graph": "{\"creator\":\"system\",\"freq\":\"0 1/1 * * * ? *\",\"alertMode\":1,\"owners\":\"admin\",\"cycle\":\"mi\",\"do_as\":\"executor\",\"flows\":[],\"name\":\"sample\",\"instId\":\"FLOW_002-202301010000\",\"id\":1002,\"relations\":[],\"parameters\":\"[]\",\"tasks\":[{\"taskName\":\"sample_task\",\"taskInstId\":\"TASK_001-202301010000\",\"x\":0.02,\"y\":0.01,\"taskId\":1001,\"nodeId\":\"t_1001\",\"status\":\"SUCCESS\"}]}",
"status": 1,
"statusDesc": "SUCCESS",
"triggerTime": "2023-01-01 00:00:00",
"startTime": "2023-01-01 00:00:01",
"endTime": "2023-01-01 00:00:02",
"timestamp": "2023-01-01 00:00:03.0",
"virtual": false,
"owner": "admin",
"alertMode": 1,
"calDt": "2022-12-31",
"hasEditPri": true,
"hasReadPri": true
}
}