I've created a bot that triggers whenever a table is updated. Since multiple users can update the table simultaneously, will the bot trigger in parallel for each update (i.e., one execution per update)?
I’m reading from and updating a separate table during each execution, which could lead to unexpected results if multiple executions run in parallel.
Is it possible to configure the bot to execute sequentially, ensuring only one execution happens at a time?
The short answer is no.
Let me explain. This is a problem not specific to any type of technology but a problem in computer science in general.
You have 2 choices when handling asynchronous/distributed editing/updating.
Whichever user arrives/initiates first puts a lock on the records/sheet and only when he/she is finished with their transaction does the lock release and the other users can make edits. This is not preferred for obvious reasons (locking, slow updates, frustrated users, bad UX)
Whichever user updates LAST their changes overwrite the previous updates. So it doesn't matter who "got there first" or "updated first", whichever change comes in last is the winner.
Another option is to use a method similar to E-tags. Each record/row has a version number on it, it can be hash or an actual integer, it doesn't matter. When the user sends an update his/her update contains the version number they are editing and the updates to make. If the version number they are editing corresponds with the current version number in the database/system, they are allowed to make updates if not an error is sent back indicating that the data is out of date and will need to refreshed before an update is executed.
I know you may not have control that granular but I think it's important to understand the fundamental problem you are trying to solve before trying a bunch of different configurations and buttons, etc.