Determining if this is last running job on Orch

Hello,
does anyone have an example of effectively checking if running job is the LAST one running?
I’d like to send to business summarizing email, but only once - when every job is done.
I’m using queue, and there can be multiple jobs running at the same time, and might end in similar time.
My first idea was to check if queue is empty and check how many jobs are running currently - but it might happen that multiple of them will have same output indicating to send email or not (empty queue and e.g. 2 jobs still running).
Is another way to do it effectively? To let business know: your request is completed, but only once when all robots are done?
Thank you.

Hi,

You could use Get Jobs activity to get list of jobs from orchestrator using Orch api’s.

You could follow this thread:

Usage of Get Jobs activity - Help - UiPath Community Forum

After this activity you can put a condition as how many running jobs are there and you can add one queue item for sending email. So sending emails are not repeated