I have the following use case. We have both a frontend application and a backend application. Earlier, events on the frontend application directly call the backend application. Now we want to introduce an orchestrator (like Camunda or similar in-house product) between the frontend and backend applications. Following will now be the sequence of events.
- User clicks on the button in frontend application. This action is part of a workflow graph and the next node in the graph linked to this button click action is to call the related backend API.
- This button click instead of directly calling the related API in backend calls another API that sends a message to a kafka topic.
- The orchestrator is listening to this kafka topic and executes the next node in the workflow graph to call the related backend API.
Questions
- Is this a correct use case for introducing an orchestrator or the previous method of directly calling backend itself was fine?
- For introducing an orchestrator between the frontend and backend applications, are the steps mentioned above correct or there is a better way?
- Many a time, we need to show the response of the backend API in the frontend. How can that part be handled when the orchestrator is added and the flow mainly becomes asynchronous?
Edit: 4. If the workflow is as follows
user_task_1 => call_API_1 => user_task_2 => call API_2
Both user tasks are button clicks on the frontend application used to manage an entity. When the first button click or user_task_1 happens, a new workflow instance is created. The status of this workflow instance is user_task_1_completed for now. Later when the user_task_2 which is again another button click on the frontend application is completed, how can we retrieve this workflow instance? Just with the entity ID, we can’t retrieve the workflow instance ID as there could be multiple button clicks or workflow instances for the same entity. Is it right to add the workflow instance IDs in the frontend application or there is some better way?