Get Flow¶
Get the information of a specified workflow.
Prerequisite¶
The user must belong to the organization (OU) which the target workflow belongs to.
Request Format¶
GET https://{apigw-address}/batch-processing-service/v2.1/flows
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Required/Optional |
Data Type |
Description |
|---|---|---|---|---|
flowId |
Query |
Required |
Integer |
The workflow ID. |
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¶
Flow Struct¶
Sample¶
{
"flowId": 3560,
"flowName": "outuser",
"active": 0,
"creator": "yourCreator",
"createTime": "2019-12-09 07:19:52.0",
"updateUser": "yourUpdateUser",
"updateTime": "2019-12-09 07:19:52.0",
"freq": "0 0 0 * * ? *",
"cycle": "D",
"parameters": "[]",
"owner": "yourOwners",
"visitor": "yourVisitors",
"doAs": "yourDoAs",
"alertMode": 3,
"graph": {
"creator": "yourCreator",
"freq": "0 0 0 * * ? *",
"owners": "yourOwners",
"type": 1,
"cycle": "D",
"alertMode": 3,
"visitors": "yourVisitors",
"doAs": "your_bd_account",
"flows": [],
"name": "outuser1",
"startTime": "2019-07-25",
"syncType": 1,
"relations": [],
"parameters": "[]",
"tasks": [
{
"x": 0.002,
"y": 0.002,
"taskName": "tass",
"nodeId": "t_106089",
"taskId": 106089
}
],
"queue": "",
"desc": ""
},
"entry": 1,
"type": 1,
"syncType": 1,
"desc": "",
"queue": "",
"startTime": "2019-07-25",
"locked": false,
"virtual": false,
"hasEditPri": true,
"hasReadPri": true,
"isUserLocked": false
}
Parameters¶
Name |
Data Type |
Description |
|---|---|---|
flowId |
Integer |
The workflow ID. |
flowName |
String |
The workflow name. |
active |
Integer |
The scheduling status of the workflow.
|
creator |
String |
The username of the user who created the workflow instance. |
createTime |
String |
The time when the workflow is created. |
updateUser |
String |
The user who updated the workflow. |
updateTime |
String |
The time when the workflow is updated. |
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 |
owner |
String |
The username of the owners of the workflow. The semicolon (;) is used to separate each owner, for example, owners=”userNameA;userNameB”. |
visitor |
String |
The username of the vistors who can access the workflow. The semicolon (;) is used to separate each visitor, for example, visitors=”userNameA;userNameB”. |
doAs |
String |
The big data account of the organization to which the workflow belongs. |
alertMode |
Integer |
The alert mode.
|
graph |
FlowGraph Struct |
The workflow dependency. For more information, see FlowGraph Struct |
entry |
Integer |
The method used for creating the workflow.
|
type |
Integer |
The scheduling type of the workflow.
|
syncType |
Integer |
The sync type of the workflow.
|
desc |
String |
The workflow description. |
startTime |
String |
The effective date of the workflow. |
virtual |
Boolean |
|
locked |
Boolean |
|
hasEditPri |
Boolean |
|
hasReadPri |
Boolean |
|
isUserLocked |
Boolean |
|
FlowGraph Struct¶
Sample¶
{
"creator": "yourCreator",
"freq": "0 0 0 * * ? *",
"owners": "yourOwners",
"type": 1,
"cycle": "D",
"alertMode": 3,
"visitors": "yourVisitors",
"doAs": "your_bd_account",
"flows": [],
"name": "outuser1",
"startTime": "2019-07-25",
"syncType": 1,
"relations": [],
"parameters": "[]",
"tasks": [
{
"x": 0.002,
"y": 0.002,
"taskName": "tass",
"nodeId": "t_106089",
"taskId": 106089
}
],
"queue": "",
"desc": ""
}
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.
|
type |
Integer |
The scheduling type of the workflow.
|
owners |
String |
The username of the owners of the workflow. The semicolon (;) is used to separate each owner, for example, |
visitors |
String |
The username of the vistors who can access the workflow. The semicolon (;) is used to separate each visitor, for example, |
startTime |
String |
The effective date of the workflow. |
cycle |
String |
The scheduling cycle.
|
doAs |
String |
The big data account of the organization to which the workflow belongs. |
flows |
Array of FlowSimpleInfo Structs |
The list of workflows that have dependency relations with the workflow. For more information, see FlowSimpleInfo Struct |
name |
String |
The workflow name. |
syncType |
Integer |
The sync type of the workflow.
|
relations |
Array of Relation Structs |
The list of the 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 TaskSimpleInfo Structs |
The list of all task nodes in the workflow, with each element representing a TaskSimpleInfo struct, which contains basic information of a task node. For more information, see TaskSimpleInfo Struct |
queue |
String |
The computing queue. |
desc |
String |
The workflow description. |
FlowSimpleInfo Struct¶
Sample¶
{
"flowId": 1001,
"flowName": "sample_workflow",
"nodeId": "f_1001",
"isVirtual": false,
"x": 0.01,
"y": 0.01
}
#### Parameters
.. list-table::
:widths: 20 30 50
:header-rows: 1
* - Name
- Data Type
- Description
* - flowId
- integer
- The workflow ID.
* - flowName
- String
- The workflow name.
* - nodeId
- String
- The ID of the node that is part of other workflows.
* - isVirtual
- Boolean
- + true = the workflow is a virtual workflow
+ false = the workflow is not a virtual workflow
* - 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.
### TaskSimpleInfo Struct
#### Sample
```json
{
"taskName": "sample_task",
"x": 0.01,
"y": 0.01,
"taskId": 1001,
"nodeId": "t_1001"
}
Parameters¶
Name |
Data Type |
Description |
|---|---|---|
taskName |
String |
The task name. |
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.) |
Relation Struct¶
Sample¶
{
"cycleGap": "D0",
"rerun": true,
"source": "t_105048",
"target": "t_104575"
}
Parameters¶
Name |
Data Type |
Description |
|---|---|---|
cycleGap |
String |
The scheduling time difference between upstream and downstream tasks, with the format of {cycle}{offset} (cycle is the unit of time different, and offset is value). |
source |
String |
The node ID of the upstream task. |
target |
String |
The node ID of the downstream task. |
rerun |
Boolean |
Effective only for task-level re-running.
|
Error Codes¶
Code |
Message |
Description |
|---|---|---|
62102 |
flow not found |
Cannot find the flow |
For other error codes, see Common Error Codes.
Sample¶
Request Sample¶
url: https://{apigw-address}/batch-processing-service/v2.1/flows?action=get&flowId=2479&userId=yourUserId&orgId=yourOrgId
method: GET
Return Sample¶
{
"code": 0,
"msg": "OK",
"data": {
"flowId": 2479,
"flowName": "sample_workflow",
"active": 0,
"creator": "system_admin",
"createTime": "2023-01-01 00:00:00.0",
"updateUser": "system_updater",
"updateTime": "2023-01-01 00:00:01.0",
"freq": "0 0 0 * * ? *",
"cycle": "D",
"parameters": "[{\"key\":\"overwrite\",\"value\":\"true\"}]",
"owner": "admin_group",
"visitor": "guest_group",
"doAs": "executor_account",
"alertMode": 1,
"graph": "{\"queue\":\"\",\"cycle\":\"D\",\"desc\":\"\",\"doAs\":\"executor_account\",\"freq\":\"0 0 0 * * ? *\",\"visitors\":\"guest_group\",\"tasks\":[{\"taskName\":\"Data-Sync\",\"taskId\":1001,\"y\":0.01,\"x\":0.01,\"nodeId\":\"t_1001\"},{\"taskName\":\"Data-Process\",\"taskId\":1002,\"y\":0.02,\"x\":0.01,\"nodeId\":\"t_1002\"}],\"type\":0,\"creator\":\"system_admin\",\"flows\":[],\"alertMode\":1,\"relations\":[{\"cycleGap\":\"D0\",\"rerun\":true,\"source\":\"t_1001\",\"target\":\"t_1002\"}],\"name\":\"sample_workflow\",\"startTime\":\"2023-01-01\",\"active\":0,\"parameters\":\"[{\\\"key\\\":\\\"overwrite\\\",\\\"value\\\":\\\"true\\\"}]\",\"owners\":\"admin_group\"}",
"entry": 0,
"type": 0,
"syncType": 1,
"desc": "",
"startTime": "2023-01-01",
"virtual": false,
"locked": false,
"hasEditPri": true,
"hasReadPri": true,
"isUserLocked": false
}
}