Commit Objects one by one when different user triggers the button (commit process) from UI

Hello Experts,   I have a microflow which has commit object activity here I am facing a problem, when multiple users from front-end triggers a commit process by clicking on button at the same time which executes the commit microflow in the backend at the same time but also I have a after commit event which has some sequence number calculation in AfterCommit which is also executing at the same time. Idly I don’t want that to happen.   So, here how can I avoid or execute the commit action or MF being triggered from front-end by different users at the same time.   Basically I am expecting that commit should happen or MF execution for the same commit process should happen one by one even though there are multiple users triggers the action at the same time in front-end so that the AfterCommit event will also execute one by one.   Answers are really much appreciated!
1 answers

One way to solve this, assuming that the user doesn't need to wait for it all to finish, would be to add the processing of the entity to the task queue. This would make the microflow kick off in the order in which the tasks are added to the queue.


Another way would be to turn on “disallow concurrent execution” but whether or not this works for your use case is something you'll have to consider.