Webinar

October 12, 2021 12:00 PM EDT
The future of RPA: Migrating to Gen-2 toolsOctober 12, 2021 12:00 PM EDT
Are you wondering if it is worth the time and money to switch RPA platforms? Join our RPA experts as they discuss all things migration & Gen-2 tools.

Running Robocorp Workforce Agent Core as a Windows Service

Control Room allows you to manage, orchestrate, and schedule the execution of your software robots in a central place. Control Room has Processes, which contain steps that Environments execute.

This article instructs how to set up the Robocorp Workforce Agent Core background process on a Windows machine.

The primary purpose of running Robocorp Workforce Agent Core as a service is to set up your machine as a constant Environment resource in Control Room just by having the machine powered on.

Prerequisites

  • If you are not familiar with Windows Services, this might not be relevant for you.
  • To follow along, you will need a Robocorp account for accessing Control Room and Robocorp Workforce Agent Core. If you haven't already, you might want to first follow the Quickstart guide to get familiar with Control Room.
  • You need to have administrator permissions on the machine to set up the Windows Service.

Limitations

A Windows Service does not have UI access to applications; this means that you can run so-called headless operations and access the machine and user resources, but you cannot, for example, take screenshots of Windows application UI's.

Set up the user for the Windows Service

The setup is simple if you log in to Windows as the user you want the Windows Service to run. The permissions of this user determine what the Windows Service can access.

The reason for running robots on local machines is to have access to some user-level resources or permissions, so running the Robocorp Workforce Agent Core as a Windows Service requires you to use some existing user account that can log in to the machine. You can set up a separate local user or use an Active Directory user.

Note: Setting up this user's permissions on the machine with the principle of least privilege is the most effective way of introducing better security.

Installing the Windows Service

To help out in the setup, we provide a simple CLI helper tool to avoid as much hassle as possible on setting up Windows Services. The helper tool downloads the Robocorp Workforce Agent Core and all needed tools and sets up the service.

Steps below detail the setup.

1. Get the helper tool to the target machine

Get the Robocorp Service Helper here

2. Fill in the arguments for the helper command

The installation command will interactively ask for the logged-in user's password; it can be left empty to be set later via Windows GUI.

robocorp-service-helper.exe install

Optional arguments:

  • -n --name "Robocorp Workforce Agent" <-- Name for the Windows Service / Windows task / Robocloud environment
  • -p --instance-path "C:\robocorp\wfa-service" <-- Path the service uses to store run data
  • -r --robocorp_home "C:\robocorp\wfa-service\home" <-- Path the service uses for environment caching
  • -d --domain <-- Domain of the user the service runs as.
    • If you are running these as the targetted user %USERDOMAIN% should be a reliable way to get the right domain.
  • -u --username <-- Username of the user the service runs as.
    • If you are running these as the targetted user %USERNAME% variable holds the correct name
  • -t --link-token <link token from Control Room>
    • Get the link token from Control Room: Go to correct workspace > Environments > Link token
      link-tokenToken is only used for linking and only valid for 1 hour, so no need to store this anywhere.
  • --ci <-- when running from CI system to make sure the tool is non-interactive

3. Run the helper command

helper-run

4. Define the user for the service

You can use the default Windows Services application to set the user for the service.

  • Start menu > type Services
  • Find the service name you gave to the command and open Properties.
  • Give the username and password to Log On > This accountservice-user

Note: You can also set Recovery options for the service as you choose.

5. Start the service

  • You can do this via the default Services application service-start

6. All done

You should now see a new environment in Control Room with the name you gave in Idle state, ready for work. done

September 14, 2021