Skip to main content

         This documentation site is for previous versions. Visit our new documentation site for current releases.      

Runtime properties, methods, and events

Updated on October 19, 2022

Use Pega Robot Runtime properties, methods, and events to interact with Robot Runtime in your automations.

Current user properties and methods

Use the Current user properties and methods to send and receive data about the logged-in user.

The following tables describe the properties and methods available for Current user:


Authentication typeGets the type of authentication used to identify the user. (String)
IsAnonymousGets a value that indicates whether the user account is identified as an anonymous account by the system. (Boolean)
IsAuthenticatedGets a value that indicates whether the user has been authenticated by the system. (Boolean)
IsGuestGets a value that indicates whether the user account is identified as a Guest account by the system. (Boolean)
IsSystemGets a value that indicates whether the user account is identified as a System account by the system. (Boolean)
NameGets the name of the current user.
UserDomainGets the domain of the current user.


MethodDescriptionParametersReturn Type

Determines whether the user belongs to the group with the specified name. Returns True if the current principal is a member of the specified Windows user group; otherwise, returns False. Note the role input parameter is case insensitive and should indicate whether the role is built-in, machine-specific, or domain-specific using this format:




If the role parameter is supplied without the BUILTIN, MachineName, or DomainName specifier, the method defaults to BUILTIN.

The spelling for the BUILTIN roles in string format differs from the spelling used in the WindowsBuiltInRole enumeration. For example, the spelling for an administrator in the enumeration is "Administrator", not "Administrators".

IsInRoleDetermines whether the user belongs to the group with the specified WindowsBuiltInRole. See the MSDN WindowsBuiltInRole Enumeration topic for more information. WindowsBuiltInRole role Boolean

Environment methods

Use the Environment methods to exchange data with the Robot Runtime environmnet in your automation.

The following table describes the available Environment methods:

MethodDescriptionParametersReturn type
ExpandEnvironmentVariablesReplaces the name of each environment variable embedded in the specified string with the string equivalent of the value of the variable, then returns the resulting string.A string containing the names of zero or more environment variables. A string with each environment variable replaced by its value.
GetComputerNameRetrieves the designated name of the computer.StringString
GetEnvironmentFolderRetrieves the path of the environment variable.StringString
GetEnvironmentVariableRetrieves the value of an environment variable from the current process.

Overloads can be a string or a string plus target variable.

The name of the environment variable.The value of the environment variable specified.
GetFolderPathGets the path to the system special folder that is identified by the specified enumeration.

Overloads can be the environment and special folder, or environment plus special folder or folder option.

One of enumeration values that identifies a system special folder.The path to the specified system special folder, if available.
SetEnvironmentVariableCreates, modifies, or deletes an environment variable.

Overloads can be either string, string; or string, string, variable target.

The name of an environment variable.

Runtime methods and events

Use Robot Runtime methods and events to exchange data with projects.

The following tables describe the available methods and events:


GetDeploymentVersionRetrieves the value of the DeploymentVersion property for the project.
GetProjectPathRetrieves the full path of the package loaded at runtime.
GetRuntimeVersionRetrieves the value of the Version property for the project. This is the version that was used when the project was last edited and saved.
ReadPackageFileRetrieves the name of the file used for deployment.
TerminateRuntimeUse this method to unload the project and close Robot Runtime.


ProjectStartedThis event occurs once, after a project is loaded. It should be the default way of being notified that projects have started.
ProjectStoppingThis event occurs once, after the project has started.

Note that the Pega RPA Service heartbeat does not rely on events to trigger a heartbeat. Instead, the heartbeat occurs after the AllProjectsStarted event fires -- after all the handlers in automation are called.

For best results, only do minimal processing in an automation that is fired by this event if you are doing it synchronously, because it delays other activities from happening.

RobotNotReadyForWorkOccurs when the ReadyForRobotWork property is set to False to indicate that the robot is not ready to perform work.
RobotReadyForWorkOccurs when the ReadyForRobotWork property is set to True to indicate that the robot is available to perform work.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us