How to understand if process has been completed for both sync and external tasks?


Currently, I am using Camunda for microservice orchestration using Apache Kafka.

The process is executed when I get a REST request from REST controller as you can see on the diagram.

Outgoing messages are going to other microservices through Kafka Brokers. At the end of the flow,
we wait for “Completed” messages from microservices in order to complete the flow.

On the other hand, outgoing REST call is an external task so it is async.

Here is a sample workflow,

The problem is: When I get a sync REST request to REST controller, I need to return a response. However, during the timeout period, it is possible that the flow might still execute or even it is completed, the external task still might execute.

Is there a way if I can check all operations are being completed successfully?

I was thinking that maybe I can use below endpoints to decide if everything completed successfully.

  1. To see if the external task completed or not:
    Camunda Automation Platform 7.21.0-SNAPSHOT REST API

GET /history/external-task-log/{id}

we can check failureLog and successLog fields of response.

  1. To see if the overall process is completed or not:
    Camunda Automation Platform 7.21.0-SNAPSHOT REST API

GET /history/process-instance/{id}

We can check the state field of the response.

So is this a reliable way to see if all activities in the process have been completed successfully?


Hi @ecaglar,

I would recommend the second option (verify the overall process is completed). That way you verify that everything has been completed.
The first option might work for you now but if the process changes and you use different model elements (for example event subprocess) might not work any longer. Or you need to take care of more tasks.
Hope this helps.