I have a simple orchestration tool that calls 3 API’s sequentially using http-connectors in service tasks. I can start the process using the camunda rest API, and am now trying to integrate this tool with an API gateway.
That is, I need to pass the header information contained in the POST request to start the process instance to all the service tasks that call the API’s. The POST request will have an access token as one of the key-value pairs of the header, and this access token has to be passed to the header information of the http-connector of each of the API’s.
Is there any way of doing this, because I haven’t found anything similar online?
You could write a custom REST API endpoint that extracts the header and then calls the Camunda Java API providing the header value as a process variable.
Another idea could be a servlet filter that sets the header value as a thread-local and that you access and store immediately as process variable when the process is started (e.g. in an execution listener). That could save the effort of rolling a custom REST API.