Find out if Robot is active on another Machine using Orchestrator API


i am trying to find a way to check during runtime if the currently running robot is user on another machine runing as well-

The underlying issue i am trying to solve is that the certain applications do not allow multiple sessions for one user and a second login aborts the first.

My idea is to use Orchestrator API.

Filtering for running Jobs i get results like

        "Key": "3234qwedxcv-9e6f-47c3-8eb2-asdfasdf",
        "StartTime": "2022-09-26T12:54:11.133Z",
        "EndTime": null,
        "State": "Running",
        "JobPriority": "Normal",
        "Source": "{Source}",
        "SourceType": "Schedule",
        "BatchExecutionKey": "059087be-2e41-4866-a60b-be0801b89910",
        "Info": "Verarbeitung des Auftrags gestartet",
        "CreationTime": "2022-09-26T12:46:01.073Z",
        "StartingScheduleId": 1,
        "ReleaseName": "{ReleaseName}",
        "Type": "Unattended",
        "InputArguments": null,
        "OutputArguments": null,
        "HostMachineName": "{HostMachineName}",
        "HasMediaRecorded": false,
        "PersistenceId": null,
        "ResumeVersion": null,
        "StopStrategy": null,
        "RuntimeType": "Unattended",
        "RequiresUserInteraction": true,
        "ReleaseVersionId": 1,
        "EntryPointPath": null,
        "OrganizationUnitId": 1,
        "OrganizationUnitFullyQualifiedName": "Default",
        "Reference": "",
        "Id": 1

Does anyone see a way to get the information if a certain User is running using the API (or any other way) during a runtime?

You should have your triggers, environment, etc set properly so this can’t happen in the first place. Then there is no need to check.

I agree thats how it should be.
maybe you have an idea for our specific underlying situation

1 User runs two business processes (they need to be on one user due to expensive licences) using an application that has an limit of 1 active session

Business process 1 starts at 6 am (runtime between 2 and 5 hours) (allocated dynamically)

Queue for Business process 2 gets filled at 8 am.

Business process 2 should start as soon as Business process 1 is done (due to both using an application with max 1 session at a time)

My idea is to use a queue trigger (therefore allocating dynamically to multiple machines) and check before login if Business process 1 is still running and if so stop processing. (Process gets queue triggered later and checks again)

Create a separate queue for the second automation, with a queue trigger that kicks off the second automation. At the end of your first automation, add an item to that queue to kick off the second automation.

that would work
I might set it up this way.

One disadvantage I see is that it creates an unwanted dependancy.
If process 1 is EOL/fails/should not run on a certain day → process 2 does not get triggered.