Hi all, I’ve seen this question asked a couple of times on the forum, but it doesn’t look like it’s ever been answered fully/sufficiently (see Get Machine Name or Name of Robot in Orchestrator, Get the robot name in the code of the robot).
I know how to get Machine Name (Environment.MachineName) and Username (Environment.Username) using Environment variables, but what I would really like to know is how to retrieve the name of the robot that is executing a process as it is defined in Orchestrator.
For example, say I have a process named “Compile Report,” and I have four robots defined in Orchestrator: Dev John Doe, Dev Jane Doe, Prod John Doe, Prod Jane Doe (for simplicity, let’s assume all robots are assigned to the same environment). If I execute the process and allocate dynamically to 1 robot, I would like to be able to retrieve the robot name during execution.
My intent is to use the robot name as part of the filepath for a custom log file. We may end up running multiple instances of the robot simultaneously, so I am trying to build with “parallelization” in mind. If the log filepath includes the robot name and a timestamp, it should be unique no matter how many robots execute the process simultaneously. Of course, there are other ways to obtain a unique identifier, like using Environment.MachineName + Environment.UserName in place of robot name, but retrieving the robot name seems like it should be so simple. My curiosity won’t let me let the question lay any longer.
Thanks in advance!