Skip to main content

Workflow API Definition

Download OpenAPI specification:Download

OpenAPI provided by workflow service

  • Task Management
  • Process Management
  • To-do Center

Authentication

Sign

Security Scheme Type: API Key
Header parameter name: Authorization

task

Query The User's Pending Task List

Authorizations:
Sign
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

Content type
application/json
{
  • "list": [
    ],
  • "pagination": {
    }
}

Submit Pending Tasks

Authorizations:
Sign
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

Content type
application/json
{
  • "taskId": "1000492908536529",
  • "username": "test",
  • "assigns": [
    ],
  • "audit": {
    },
  • "comment": "leave for more than 5 days, disagreed",
  • "formData": "{}"
}

Response samples

Content type
application/json
{
  • "code": 100108502,
  • "message": "The parameter 'username' cannot be empty"
}

Save form data associated with pending tasks

Authorizations:
Sign
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

Content type
application/json
{
  • "taskId": "1000492908536529",
  • "username": "test",
  • "formData": "{}"
}

Response samples

Content type
application/json
{
  • "code": 100108237,
  • "message": "Pending tasks do not exist"
}

Query Pending Task Details

Authorizations:
Sign
path Parameters
taskId
required
string

pending task ID

query Parameters
username
required
string

username

Responses

Response samples

Content type
application/json
{
  • "companyId": "1000",
  • "assigns": [
    ],
  • "audits": [
    ],
  • "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 total number of pending tasks for the user

Authorizations:
Sign
query Parameters
username
required
string

username

Responses

Response samples

Content type
application/json
{
  • "code": 100108502,
  • "message": "The parameter 'username' cannot be empty"
}

Query the user's completed task list

Authorizations:
Sign
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

Content type
application/json
{
  • "list": [
    ],
  • "pagination": {
    }
}

Query completed task details

Authorizations:
Sign
path Parameters
taskId
required
string

pending task ID

query Parameters
username
required
string

username

Responses

Response samples

Content type
application/json
{
  • "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:
Sign
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

Content type
application/json
{
  • "mandatary": "zhangsan",
  • "username": "test",
  • "reason": "business trip",
  • "taskId": "1000492908536529"
}

Response samples

Content type
application/json
{
  • "code": 100108502,
  • "message": "The parameter 'username' cannot be empty"
}

Revoke Pending Tasks

Authorizations:
Sign
Request Body schema: application/json

send in json format

taskId
string

pending task ID

username
required
string

username

Responses

Request samples

Content type
application/json
{
  • "taskId": "1000492908536529",
  • "username": "test"
}

Response samples

Content type
application/json
{
  • "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:
Sign
query Parameters
current
required
integer >= 1

current page number

pageSize
required
integer [ 1 .. 500 ]

pageSize

Responses

Response samples

Content type
application/json
{
  • "list": [
    ],
  • "pagination": {
    }
}

process

Query Details For The Process Initiation

Authorizations:
Sign
path Parameters
processKey
required
string

process number

Responses

Response samples

Content type
application/json
{
  • "companyId": "1000",
  • "assigns": [
    ],
  • "audits": [
    ],
  • "enableComment": true,
  • "multiCompany": true,
  • "enableSave": false,
  • "processName": "leave application process",
  • "readOnly": false,
  • "firstTaskName": "edit",
  • "url": "Page_0a4f3b38124142cbae4dae62f6664f5a"
}

query process details

Authorizations:
Sign
path Parameters
processId
required
string

process ID

query Parameters
username
required
string

username

Responses

Response samples

Content type
application/json
{
  • "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": [
    ]
}

query process logs

Authorizations:
Sign
path Parameters
processId
required
string

process ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Query reminder information

Authorizations:
Sign
path Parameters
processId
required
string

process ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Query the user-initiated process list

Authorizations:
Sign
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

Content type
application/json
{
  • "list": [
    ],
  • "pagination": {
    }
}

Save API On Process Initiation Page

After clicking save, the process will start and stay at the first user section

Authorizations:
Sign
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

Content type
application/json
{
  • "appId": "App_eab56959eef74c1ea2e1a5fbe7b38ddf",
  • "formData": "{}",
  • "processKey": "K2002018123456789",
  • "username": "test"
}

Response samples

Content type
application/json
{
  • "processId": "1000492908536528",
  • "taskId": "1000492908536529"
}

Initiate Process

Authorizations:
Sign
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

Content type
application/json
{
  • "appId": "App_eab56959eef74c1ea2e1a5fbe7b38ddf",
  • "assigns": [
    ],
  • "audit": {
    },
  • "comment": "leave for more than 5 days, disagreed",
  • "formData": "{}",
  • "processKey": "K2002018123456789",
  • "processName": "leave application001process",
  • "username": "test"
}

Response samples

Content type
application/json
{
  • "processId": "1000492908536528"
}

Cancel process. The interface is currently available for regular users.

Authorizations:
Sign
path Parameters
processId
required
string

process instance ID

Request Body schema: application/json

send in json format

username
required
string

username

Responses

Request samples

Content type
application/json
{
  • "username": "test"
}

Response samples

Content type
application/json
{
  • "code": 100108227,
  • "message": "The process instance does not exist"
}

todoCenter

to-do center

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:
Sign
Request Body schema: application/json

send in json format

Array (<= 200 items)
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
  • Third-party source name, such as mes.supos.com=Production Manufacturing System. It is recommended to follow DNS conventions to avoid conflicts, and the conventions are as follows:
  • only contain lowercase letters, numbers, '-' and '.'
  • start and end with an alphanumeric character
openUrl
string <= 1024 characters

addresses displayed for different workflows, such as opening the form page for a task

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    }
]

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:
Sign
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

Content type
application/json
{
  • "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:
Sign
Request Body schema: application/json

send in json format

Array (<= 200 items)
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
  • Third-party source name, such as mes.supos.com=Production Manufacturing System. It is recommended to follow DNS conventions to avoid conflicts, and the conventions are as follows
  • only contain lowercase letters, numbers, '-' and '.'
  • start and end with an alphanumeric character

Responses

Request samples

Content type
application/json
[
  • {
    }
]

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:
Sign
Request Body schema: application/json

send in json format

Array (<= 200 items)
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
  • Third-party source name, such as mes.supos.com=Production Manufacturing System. It is recommended to follow DNS conventions to avoid conflicts, and the conventions are
  • only contain lowercase letters, numbers, '-' and '.'
  • start and end with an alphanumeric character.
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

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    }
]

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:
Sign
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

Content type
application/json
{
  • "code": 100000001,
  • "message": "Internal service exception"
}