How to tell which unattended bot in a team is the last one running

We have a scenario where we have a job scheduled to run on multiple bots at the same time. When all work queue items have been processed, the process should send a report email with details of the work completed.

What I want to know is how to implement a check so that when each bot encounters the empty work queue it will check if there are any other robots still processing items from that work queue, and only if the bot is the last one running will it create the report and send the email. it’s basically a ‘last one out turns the lights off’ check.

What are the possible options that people know of for bots to be aware of what their ‘teammates’ are doing?