Workflow API Definition
Download OpenAPI specification:Download
OpenAPI provided by workflow service
- Task Management
- Process Management
- To-do Center
Query The User's Pending Task List
Authorizations:
query Parameters
appId | string APP ID |
username required | string username |
current | string current page number-default 1 |
pageSize | string current page number-default 10 |
Responses
Response samples
- 200
- 400
- 500
{- "list": [
- {
- "initiator": "zhangsan",
- "processId": "1000492908536528",
- "processName": "leave application-001",
- "startTime": "2020-09-22T07:38:13.893+0800",
- "status": 88,
- "taskId": "1000492908536529",
- "taskName": "edit",
- "url": "Page_0a4f3b38124142cbae4dae62f6664f5a",
- "type": 0,
- "modifyTime": "2020-09-22T07:38:13.893+0800",
- "userName": "zhangsan",
- "personCode": "zhangsan"
}
], - "pagination": {
- "current": 0,
- "pageSize": 0,
- "total": 0
}
}
Submit Pending Tasks
Authorizations:
Request Body schema: application/json
send in json format
taskId required | string pending task ID |
username required | string username |
Array of objects (AssigneeRequest) assigner(username)list | |
object (AuditRequest) | |
comment | string remark |
formData | string form JSON data |
Responses
Request samples
- Payload
{- "taskId": "1000492908536529",
- "username": "test",
- "assigns": [
- {
- "taskDefKey": "userTask_123",
- "users": [
- "test1",
- "test2"
]
}
], - "audit": {
- "seqKey": "edge_123",
- "value": "1"
}, - "comment": "leave for more than 5 days, disagreed",
- "formData": "{}"
}
Response samples
- 400
- 500
{- "code": 100108502,
- "message": "The parameter 'username' cannot be empty"
}
Save form data associated with pending tasks
Authorizations:
Request Body schema: application/json
send in json format
taskId required | string pending task ID |
username required | string username |
formData | string form data |
Responses
Request samples
- Payload
{- "taskId": "1000492908536529",
- "username": "test",
- "formData": "{}"
}
Response samples
- 400
- 500
{- "code": 100108237,
- "message": "Pending tasks do not exist"
}
Query Pending Task Details
Authorizations:
path Parameters
taskId required | string pending task ID |
query Parameters
username required | string username |
Responses
Response samples
- 200
- 400
- 500
{- "companyId": "1000",
- "assigns": [
- {
- "seqKey": "edge_123",
- "taskDefKey": "userTask_123",
- "name": "approval"
}
], - "audits": [
- {
- "id": "K1236",
- "name": "branch name",
- "order": 1,
- "value": "1",
- "type": 0
}
], - "enableComment": true,
- "formData": "{}",
- "formTempData": "{}",
- "initiator": "zhangsan",
- "processId": "1000492908536528",
- "processName": "leave application-001",
- "readonly": true,
- "showlog": true,
- "multiCompany": false,
- "addInstance": false,
- "startTime": "2020-09-22T07:38:13.893+0800",
- "status": 88,
- "taskId": "1000492908536529",
- "taskName": "edit",
- "url": "Page_0a4f3b38124142cbae4dae62f6664f5a"
}
Query the user's completed task list
Authorizations:
query Parameters
appId | string APP ID |
username required | string username |
current | string current page number-default 1 |
pageSize | string current page number-default 10 |
Responses
Response samples
- 200
- 400
- 500
{- "list": [
- {
- "initiator": "zhangsan",
- "processId": "1000492908536528",
- "processName": "leave applicaton-001",
- "reject": false,
- "startTime": "2020-09-22T07:38:13.893+0800",
- "endTime": "2020-09-22T07:38:13.893+0800",
- "taskId": "1000492908536529",
- "taskName": "edit",
- "url": "Page_0a4f3b38124142cbae4dae62f6664f5a"
}
], - "pagination": {
- "current": 0,
- "pageSize": 0,
- "total": 0
}
}
Query completed task details
Authorizations:
path Parameters
taskId required | string pending task ID |
query Parameters
username required | string username |
Responses
Response samples
- 200
- 400
- 500
{- "initiator": "zhangsan",
- "processId": "1000492908536528",
- "processName": "leave application-001",
- "formData": "{}",
- "reject": false,
- "revoke": false,
- "showlog": true,
- "startTime": "2020-09-22T07:38:13.893+0800",
- "endTime": "2020-09-22T07:38:13.893+0800",
- "taskId": "1000492908536529",
- "taskName": "edit",
- "url": "Page_0a4f3b38124142cbae4dae62f6664f5a"
}
Pending task delegation
Authorizations:
Request Body schema: application/json
send in json format
mandatary required | string trustee |
username required | string delegator |
reason | string reason for delegation |
taskId required | string pending task ID |
Responses
Request samples
- Payload
{- "mandatary": "zhangsan",
- "username": "test",
- "reason": "business trip",
- "taskId": "1000492908536529"
}
Response samples
- 400
- 500
{- "code": 100108502,
- "message": "The parameter 'username' cannot be empty"
}
Revoke Pending Tasks
Authorizations:
Request Body schema: application/json
send in json format
taskId | string pending task ID |
username required | string username |
Responses
Request samples
- Payload
{- "taskId": "1000492908536529",
- "username": "test"
}
Response samples
- 400
- 500
{- "code": 100108502,
- "message": "The parameter 'username' cannot be empty"
}
paging query all users' pending task lists
- Use case: When a third-party system wants to synchronize all pending task data from supOS to its own system, it can use this interface to paginate and retrieve the full set of pending task data. Incremental pending task data can be obtained by subscribing to the task change messages through the WebHook service (refer to the Data Push section for more details).
- When synchronizing all pending task data from the third-party service, it should first call this interface to retrieve the full historical data of pending tasks.
- After synchronizing the historical data, it should subscribe to the task change event topic (supOS_workflow_event) through the WebHook. Newly added pending tasks will be sent via the WebHook.
- Duplicate data may occur in the WebHook data push, and the subscriber should handle idempotent processing.
- If this interface is called multiple times, the business should handle idempotency issues on their own.
- This interface will paginate and return all pending task data for all users in the supOS system. Since it is a paginated interface, the calling party needs to design and query all pages to obtain the complete set of data.
Authorizations:
query Parameters
current required | integer >= 1 current page number |
pageSize required | integer [ 1 .. 500 ] pageSize |
Responses
Response samples
- 200
{- "list": [
- {
- "initiator": "zhangsan",
- "processId": "1000492908536528",
- "processName": "leave application-001",
- "startTime": "2020-09-22T07:38:13.893+0800",
- "status": 88,
- "taskId": "1000492908536529",
- "taskName": "edit",
- "url": "Page_0a4f3b38124142cbae4dae62f6664f5a",
- "type": 0,
- "modifyTime": "2020-09-22T07:38:13.893+0800",
- "userName": "zhangsan",
- "personCode": "zhangsan"
}
], - "pagination": {
- "current": 0,
- "pageSize": 0,
- "total": 0
}
}
Query Details For The Process Initiation
Authorizations:
path Parameters
processKey required | string process number |
Responses
Response samples
- 200
- 400
- 500
{- "companyId": "1000",
- "assigns": [
- {
- "seqKey": "edge_123",
- "name": "approval"
}
], - "audits": [
- {
- "seqKey": "edge_123",
- "name": "agree",
- "order": 1,
- "value": "1",
- "type": 0
}
], - "enableComment": true,
- "multiCompany": true,
- "enableSave": false,
- "processName": "leave application process",
- "readOnly": false,
- "firstTaskName": "edit",
- "url": "Page_0a4f3b38124142cbae4dae62f6664f5a"
}
query process details
Authorizations:
path Parameters
processId required | string process ID |
query Parameters
username required | string username |
Responses
Response samples
- 200
- 400
- 500
{- "appId": "App_325ea305252fe5d0d1f78b1c2efe2413",
- "processId": "1000492908536528",
- "processName": "leave application process",
- "endTime": "2020-09-22T07:38:13.893+0800",
- "startTime": "2020-09-22T07:38:13.893+0800",
- "status": 88,
- "tasks": [
- {
- "username": "test",
- "taskId": "1000492908536528",
- "taskName": "approval"
}
]
}
Response samples
- 200
- 400
- 500
[- {
- "auditResult": "agree",
- "comment": "business trip",
- "createTime": "2020-09-22T07:38:13.893+0800",
- "operateDesc": "Approved by Zhang San",
- "operator": "test",
- "taskName": "approval",
- "type": "TASK_COMPLETE"
}
]
Query reminder information
Authorizations:
path Parameters
processId required | string process ID |
Responses
Response samples
- 200
- 400
- 500
[- {
- "taskId": "1000711857627856",
- "taskName": "approval",
- "url": "Page_3d5f89e8578f4d3796f6fb6d4bda49b6",
- "users": [
- {
- "username": "test",
- "showName": "test user"
}
]
}
]
Query the user-initiated process list
Authorizations:
query Parameters
appId | string application ID |
status | string 88-operating(default), 77-suspended, 99-canceled, 66-completed |
username required | string username |
current | string current page number-default 1 |
pageSize | string current page number-default 10 |
Responses
Response samples
- 200
- 400
- 500
{- "list": [
- {
- "appId": "App_325ea305252fe5d0d1f78b1c2efe2413",
- "processId": "1000492908536528",
- "processName": "leave application process",
- "endTime": "2020-09-22T07:38:13.893+0800",
- "startTime": "2020-09-22T07:38:13.893+0800",
- "status": 88,
- "tasks": [
- {
- "username": "test",
- "taskId": "1000492908536528",
- "taskName": "approval"
}
]
}
], - "pagination": {
- "current": 0,
- "pageSize": 0,
- "total": 0
}
}
Save API On Process Initiation Page
After clicking save, the process will start and stay at the first user section
Authorizations:
Request Body schema: application/json
send in json format
appId | string app id |
formData | string form data |
processKey required | string process number |
username required | string username |
Responses
Request samples
- Payload
{- "appId": "App_eab56959eef74c1ea2e1a5fbe7b38ddf",
- "formData": "{}",
- "processKey": "K2002018123456789",
- "username": "test"
}
Response samples
- 200
- 400
- 500
{- "processId": "1000492908536528",
- "taskId": "1000492908536529"
}
Initiate Process
Authorizations:
Request Body schema: application/json
send in json format
appId | string app id |
Array of objects (AssigneeRequest) assigner(username)list | |
object (AuditRequest) | |
comment | string remark |
formData | string form data |
processKey required | string process number |
processName | string process instance name |
username required | string username |
Responses
Request samples
- Payload
{- "appId": "App_eab56959eef74c1ea2e1a5fbe7b38ddf",
- "assigns": [
- {
- "taskDefKey": "userTask_123",
- "users": [
- "test1",
- "test2"
]
}
], - "audit": {
- "seqKey": "edge_123",
- "value": "1"
}, - "comment": "leave for more than 5 days, disagreed",
- "formData": "{}",
- "processKey": "K2002018123456789",
- "processName": "leave application001process",
- "username": "test"
}
Response samples
- 200
- 400
- 500
{- "processId": "1000492908536528"
}
Cancel process. The interface is currently available for regular users.
Authorizations:
path Parameters
processId required | string process instance ID |
Request Body schema: application/json
send in json format
username required | string username |
Responses
Request samples
- Payload
{- "username": "test"
}
Response samples
- 400
- 500
{- "code": 100108227,
- "message": "The process instance does not exist"
}
Add Workflow Data In Batches
- Due to the possibility of historical data during initiation, the input parameter for API is list to reduce excessive API calls
- The data returned generates id data, and the corresponding distributed transaction is asynchronously implemented by the consumer through a deletion API
- thirdPartyInstanceId is a unique identifier for the third-party system's process instance. When combined with the source, it is globally unique within the system. If duplicate data exists, all submission will fail in a single request
- Note that the source of a single request must be consistent, or an error will be reported.
- The default status is operating, meaning in progress
- The openUrl address is displayed by adding a new browser tag
- The default character set of the thirdPartyInstanceId field system is case-insensitive. Take care to avoid conflicts
Authorizations:
Request Body schema: application/json
send in json format
processName required | string <= 200 characters process name |
status required | string Enum: "operating" "pause" "cancellation" "completed" process status operating(default), pause, cancellation, completed |
startTime required | string receive pending task time or process initiation time, format yyyy-MM-dd'T'HH:mm:ss.SSSZ |
completeTime | string end time, format yyyy-MM-dd'T'HH:mm:ss.SSSZ |
staffName required | string <= 64 characters username of process initiator |
thirdPartyInstanceId required | string <= 50 characters Third-party process instanceid, a unique process identifier |
thirdPartyInstanceCode | string <= 64 characters Third-party workflow instance code, also used to identify a workflow, but generated according to certain business rules for display on the page |
source required | string <= 32 characters
|
openUrl | string <= 1024 characters addresses displayed for different workflows, such as opening the form page for a task |
Responses
Request samples
- Payload
[- {
- "processName": "***process",
- "status": "operating",
- "startTime": "2020-09-22T07:38:13.893+0800",
- "completeTime": "2020-09-22T07:38:13.893+0800",
- "staffName": "Zhang San",
- "thirdPartyInstanceId": "123456",
- "thirdPartyInstanceCode": "123456",
- "source": "mes.supos.com",
- "openUrl": ""
}
]
Response samples
- 200
- 500
[- {
- "id": 123456,
- "thirdPartyInstanceId": "123456"
}
]
Delete Process Data In Batches
- This API is primarily used to ensure data consistency. In distributed scenarios, this API is called during rollback processes to delete the created data when there are code or environment errors.
- It is not recommended to delete normally created data. For processed or invalidated statuses, please use the modification API for updates.
- Deletion can be performed using either the process ID [using the ids parameter] or the corresponding third-party instance ID [using the thirdPartyInstanceIds parameter].
- The id and thirdPartyInstanceId are combined and deleted as long as one is associated with the data.
- Since this API only deletes process information, it does not delete data related to process status such as completed or pending tasks. If necessary, please call the relevant API to delete it.
- If all parameters are empty, no content will be deleted.
- This API is idempotent, meaning that multiple requests with the same parameters do not report errors, and content without the need for deletion is displayed normally.
Authorizations:
query Parameters
ids | Array of integers <= 200 items provide the ids of the process records to be deleted, separated by commas. A maximum of 200 ids are allowed. |
thirdPartyInstanceIds | Array of strings <= 200 items provide thirdPartyInstanceId records to be deleted, separated by commas. A maximum of 200 ids are allowed |
source | string The corresponding data source must be consistent for a single request. If the thirdPartyInstanceIds parameter is not empty, the source must be provided. |
Responses
Response samples
- 500
{- "code": 100000001,
- "message": "Internal service exception"
}
Modify Process Data In Batches
- This API is primarily used to update process data, such as changing the status to completed and adding completion time.
- Priority is given to using the id to update the data. If the id does not exist, the data will be modified based on the thirdPartyInstanceId.
- If there is data that does not exist in the id and thirdPartyInstanceId fields, an error rollback is reported
- When using the thirdPartyInstanceId to determine the data, the source must exist.
- If multiple records are found for the corresponding thirdPartyInstanceId, an error rollback is reported.
- Note that the source of a single request must be consistent, or an error will be reported.
- When a data error occurs, all operations are rolled back and not stored.
Authorizations:
Request Body schema: application/json
send in json format
id | integer primary key |
processName required | string <= 200 characters process name |
status required | string Enum: "operating" "pause" "cancellation" "completed" process status operating(default), pause, cancellation, completed |
startTime required | string receive pending task time or process initiation time, format yyyy-MM-dd'T'HH:mm:ss.SSSZ |
completeTime | string end time, format yyyy-MM-dd'T'HH:mm:ss.SSSZ |
staffName required | string <= 64 characters username of process initiator |
thirdPartyInstanceId required | string <= 50 characters third-party process instanceid, a unique process identifier |
source required | string <= 32 characters
|
Responses
Request samples
- Payload
[- {
- "id": 123456,
- "processName": "***process",
- "status": "operating",
- "startTime": "2020-09-22T07:38:13.893+0800",
- "completeTime": "2020-09-22T07:38:13.893+0800",
- "staffName": "Zhang San",
- "thirdPartyInstanceId": "123456",
- "source": "mes.supos.com"
}
]
Add Process Status Data In Batches
- Due to the possibility of historical data during initiation, the input parameter for API is list to reduce excessive API calls
- The data returned generates id data, and the corresponding distributed transaction is asynchronously implemented by the consumer through a deletion API
- If the third party has a unique identifer for the corresponding process node, you can enter 'thirdPartyInstanceNodeId' for subsequent deletion operations
- The 'taskStatus' indicates the status information entrust completive pending
- Note that the source of a single request must be consistent, or an error will be reported.
- The default character set of the thirdPartyInstanceId and thirdPartyInstanceNodeId field system is case-insensitive. Take care to avoid conflicts
Authorizations:
Request Body schema: application/json
send in json format
taskStatus required | string <= 20 characters Enum: "entrust" "completive" "pending" process node state entrust completive pending |
personName required | string <= 64 characters username handling the process node |
processName required | string <= 200 characters process name |
taskName required | string <= 128 characters pending task name |
initiator required | string <= 64 characters username of the initiator |
startTime | string receive pending task time, mandatory for pending tasks and completed tasks, format yyyy-MM-dd'T'HH:mm:ss.SSSZ |
endTime | string end time, mandatory for completed tasks, format yyyy-MM-dd'T'HH:mm:ss.SSSZ |
mandataryName | string <= 64 characters Name of the delegated user, mandatory for delegated tasks |
entrustTime | string Delegation time, mandatory for delegated tasks yyyy-MM-dd'T'HH:mm:ss.SSSZ |
reason | string <= 512 characters Reason for delegation |
thirdPartyInstanceId required | string <= 50 characters Third-party process instance ID, a unique process identifier |
thirdPartyInstanceNodeId required | string <= 50 characters third-party process node ID |
openUrl required | string <= 1024 characters addresses displayed for different workflows, such as opening the form page for a task |
source required | string <= 32 characters
|
thirdPartyInstanceCode | string <= 64 characters Third-party process instance code, also used to identify a process, but generated according to certain business rules for display on the page |
thirdPartyProcessEntityCode | string <= 64 characters form model code associated with the third-party process, for tasks only |
thirdPartyProcessFormId | integer form ID associated with the third-party process, for tasks only |
thirdPartyProcessMemo | string <= 2000 characters third-party summary data, for tasks only |
Responses
Request samples
- Payload
[- {
- "taskStatus": "completive",
- "personName": "Zhang San",
- "processName": "×× process",
- "taskName": "**approval",
- "initiator": "Zhang San",
- "startTime": "2020-09-22T07:38:13.893+0800",
- "endTime": "2020-09-22T07:38:13.893+0800",
- "mandataryName": "Li Si",
- "entrustTime": "2020-09-22T07:38:13.893+0800",
- "reason": "business trip, transferred to others",
- "thirdPartyInstanceId": "123456",
- "thirdPartyInstanceNodeId": "123456",
- "openUrl": "",
- "source": "mes.supos.com",
- "thirdPartyInstanceCode": "123456",
- "thirdPartyProcessEntityCode": "code",
- "thirdPartyProcessFormId": 123456,
- "thirdPartyProcessMemo": "This is a summary"
}
]
Response samples
- 200
- 500
[- {
- "id": 123456,
- "thirdPartyInstanceNodeId": "123456",
- "source": "mes.supos.com",
- "taskStatus": "completive"
}
]
Delete Process Status Data In Batches
- The created flow is deleted to maintain data consistency in distributed scenarios. No operation is performed when empty data is transferred
- After a pending task is completed, this API requires to be called to delete the historical data.
- Deletion can be performed using either the process ID [using the ids parameter] or the corresponding third-PartyInstanceNodeId [using the thirdPartyInstanceNodeIds parameter].
- When using the thirdPartyInstanceNodeId for data operations, the source parameter is mandatory.
- If all parameters are empty, no content will be deleted.
- This API is idempotent, meaning that multiple requests with the same parameters do not report errors, and content without the need for deletion is displayed normally.
Authorizations:
query Parameters
ids | Array of integers <= 200 items provide the IDs of the completive task records, separated by commas. A maximum of 200 IDs are allowed. |
thirdPartyInstanceNodeIds | Array of strings <= 200 items provide the thirdPartyInstanceNodeIds of the records to be deleted, separated by commas. A maximum of 200 IDs are allowed. |
source | string data source |
taskStatus required | string Enum: "entrust" "completive" "pending" process node state entrust completive pending |
Responses
Response samples
- 500
{- "code": 100000001,
- "message": "Internal service exception"
}