Scripts can be used to start a process instance by building a payload.
For example, use the process definition ID and set the process variables using:
let startProcessInstanceCmd = processPayloadBuilder.start() .withProcessDefinitionKey("Process_GyW7Ekkw") .withVariable("orderNumber": variables.orderNumber) .withVariable("quantity": variables.quantity) .build(); commandProducer.send(startProcessInstanceCmd);
The following APIs are available for script use: