This operation creates a process instance without starting it. Use it operation when you need to prepare a process instance before starting it later.
The base request is:
createProcessInstance()
Use the optional CreateProcessInstancePayload when a script needs to create a process instance without starting it immediately. The created process instance can be started later using startCreatedProcess(...).
The following is an example for a process instance that will be started later:
const createProcessPayload = {
processDefinitionKey: 'orderProcess',
name: 'Order Review',
businessKey: variables.businessKey
};
variables.createdProcess =
new RuntimeProcessInstanceService()
.createProcessInstance(createProcessPayload);
A CreateProcessInstancePayload object is created. processDefinitionKey: 'orderProcess' specifies the process definition to use. name: 'Order Review' assigns a name to the process instance. businessKey: variables.businessKey associates the process instance with a business identifier stored in the businessKey process variable. createProcessInstance(...) creates the process instance and returns the resulting process instance object.