Call API with long time response in Service Task camunda

Dear all,
Now I am having implementation for scheduler service which will run for synthesizing data (about 10 APIs) in sequence. Especially, each API have long execution time (about 30 minutes)
Question 1: How to implement this requirement in BPMN. which component I should choose connector, external task, service task.
Question 2: Can I call asynchonus each API and waiting response to call next API?
Quesion 3: Each exteral APi with long time response not only call by my BPM process but also call by some system. How can I know exactlly which API was completed for each process.

This might not be exactly what you are looking for, but for long-execution API calls that would fall far outside of a timeout or have unreliable execution times, I’ve used a user task that is assigned to a process id or unique id, then completed by the backend using the Camunda REST API.

  1. Make async call to API (fire and forget type)
  2. Generate user task, using a unique process identifier for the assigned user, the user task then stops the process. To your discretion you may use whatever you use to identify processes here, in my case it’s an id linked to a database entry.
  3. Once backend API call has finished processing (may be minutes, may be hours, may be days) using the Camunda Rest API send a POST task/complete call to the specific task in the process. You can get the right task filtering by user assignee = your unique id.
  4. This sends the process forward in an asynchronous manner that is also easy to manage in case we want to manually force forward a process instance.

Regarding question two, you can make multiple async calls, managing the race condition then may be handled by a conditional decision flow or using the method above to ensure the process only moves forward once the API call has finished.

As for knowing which API has completed each call, you may rely on a variable inside the Camunda process that is filled as return from the API in the process scope for those that you call from inside the process, or may rely on an external database to write down the timestamp & status of the API and retrieve those by your own api call to get the status.