I noticed that process flow is synchronous . The Restful POST call is taking good 40-50 secs to complete the flow and then return back processInstance Id. I worry that in PROD environment the request will get timed out .
Is it possible to return back the instance.getProcessInstanceId() right away and then carry through the flow executing individual sequential service tasks ? If so where and what changes are needed in Springboot 2.0 setup ?
runtimeService.startProcessInstanceByKey() starts the process synchronously up to the first wait state in your process. For it to be taking this long, you must have a service task that takes some time as your first task. If you mark it as async in the process, it will create a job and return right away. At some future point the async executor will pick it up and run it.
Thankyou wwitt. I tagged first service task with flowable:async=“true” and it behaved as suggested. I am yet to test if it has impacted overall job flow but the start definitley looks promising. Appreciate your quick response.