This operation starts a process instance that was created earlier. Use this operation after createProcessInstance() when the process instance has been prepared and is ready to run.
The base request is:
startCreatedProcess()
The following example starts a previously created process instance:
variables.process =
new RuntimeProcessInstanceService()
.startCreatedProcess(
variables.processInstanceId,
{ payloadType: 'StartProcessPayload' }
);
Use StartProcessPayload when a script starts a new process immediately or starts a process instance that was created earlier.
The following example defines a payload that includes process metadata and variables:
const startProcessPayload = {
processDefinitionKey: 'orderProcess',
name: 'Order Review',
businessKey: variables.businessKey,
variables: {
orderId: variables.orderId,
priority: 'HIGH'
}
};
When a process is started with a StartProcessPayload , the runtime uses the supplied metadata and variables to initialize the process instance before execution begins.