This operation retrieves a list of process instances. Use it to perform runtime process lookups and optionally apply paging or sorting parameters.
The base request is:
getProcessInstances()
The following example retrieves up to 10 process instances:
variables.processes =
new RuntimeProcessInstanceService()
.getProcessInstances({ maxItems: 10 });
Use the optional RuntimeQueryMap when an API operation accepts optional paging or sorting parameters. The following example retrieves process instances using paging and sorting options:
const queryMap = {
skipCount: 0,
maxItems: 25,
sort: 'id,DESC'
};
variables.processes =
new RuntimeProcessInstanceService()
.getProcessInstances(queryMap);
Because this operation returns the results immediately, the script can use the retrieved process instances in subsequent logic, such as filtering records, inspecting process details, or selecting a process instance for further runtime operations.