I have a process which is started by using REST API. I want to validate variables in the request and return response with status code 400 if something is wrong. If all the variables are valid, then it should return 200 and continue process asynchronously.
How I’m trying to achieve it now:
Start the process synchronously, the first task validates variables via inline script and throws BpmnError, which is caught by boundary error event and then goes to Error End Event. If data is valid, then process just continues (I use async after on validation task).
The problem is that regardless of any errors the rest api always returns 200 OK.
How can I fix this and get 400 status code in response? Or maybe there are other ways to validate incoming request?
Camunda platform 7, <camunda.version>7.13.0</camunda.version>
test_validation_1.bpmn (4.2 KB)