Scheduling the script

Bots that run without human assistance to complete its tasks are good choices for scheduling. The third task that you need to accomplish to automatize a process is to deploy the script. This procedure teaches you how to do it by using the scheduler.

Before you begin

This procedure assumes that you completed the "Publishing the script" task.

Before you schedule your script, make sure you comply with the following requirements:

Computer requirements
Validate if your computer exists in your tenant. In the "Validating the installation" topic, complete the Checking whether the computer was created procedure.

The script needs an active console session on the computer to run. This means that the computer needs a user who is logged in so that the script can run on it. The unlock machine feature for schedules can activate the console session. So, if you don't want to use it, make sure that the console session is active.

For virtual machines, you must set your schedule to unlock the computer, and add a credential either to the computer or to the schedule. Notice that scheduled scripts run by using the user account on Windows™ only and requires a credential to unlock the machine.

Product requirements
Bot Runtime license

User requirements

  • User access to a tenant
  • Permission to schedule jobs or to manage schedules

For more information about how to manage user's roles and permissions, see Procedure for managing user's roles.

Script consideration

Set your script to allow scheduling.

Procedure

The following video explains how you can create a schedule to run once a day.



The following steps describe how you can schedule a script. They show the steps in a generic way, and don't refer to the whole steps shared in the previous video.

Define the script

Important:Starting from IBM RPA 23.0.7, Scheduling scripts is deprecated. Use Scheduling bots instead. For more information, see Deprecated.
  1. Log in to IBM RPA Control Center.
  2. From the Define menu, click Scripts.
  3. Locate the script that you want to schedule.
  4. Click the vertical ellipsis button ⋮ > Create Schedule option.
  5. The Create schedule window prompts to the script selected. Enter the following values:
    1. From the Version list, select the script's version.
    2. In the Name field, enter the schedule's name.
    3. Optional: In the Description field, enter the schedule description.
    4. From the Computers list, select the computer to run the script.
    5. Optional: From the Credentials list, select the computer's credentials. You don't need to select a value if your computer already has a credential that is bound to it.
  6. Click Next.
Important:Scheduling does not take into consideration the production version.

Define the schedule

Define the script schedule based on how many times you want the script to run in weekdays. Follow the steps based on your schedule preferences:

Define the schedule to run once a day

  1. In the Execution Type field, select Execute once a day.
  2. In the Weekdays checkbox, select the weekdays you want to run the schedule.
  3. In the Start time field, enter the time that the script must start running.
  4. Optional: Set Unlock machine to On to unlock the machine when the schedule runs.

Define the schedule to run more than once a day

  1. In the Execution Type field, select Execute more than once a day.
  2. In the Weekdays checkbox, select the weekdays that you want to run the schedule.
  3. In the Start time field, enter the time that the script must start running.
  4. In the Stop time field, enter the time that the script must stop running.
  5. In the Interval field, enter the time interval that the script must take before to restart running. The script starts again based on the time that it takes to finish its runtime plus the time that is defined as time interval.
    Remember:The time format follows the 24-hour clock convention of time. You define the schedule times in hours and minutes, for example, 09:00 or 16:30.
  6. Optional: Set Unlock machine to On to unlock the machine when the schedule runs.

Results

After the time you defined your schedule, go to the IBM RPA Control Center, and search for your script name in the Scripts page. Click it and go to the Jobs tab. The status Finished indicates that your scheduled script ran successfully.