How to schedule API Tasks
- Updated: 2024/11/04
How to schedule API Tasks
Scheduling an API Task enables you to initiate automations that are independent of Bot Runner infrastructure (users and devices). As API Tasks run on Cloud, it eliminates the need for individual user licenses, thereby saving cost and simplifying automation management.
Prerequisites
- Schedule my bots to run
- Manage ALL scheduled activity from my Folders permission at the folder level for specific API Task and any dependencies
- Run as user API Tasks.
For more information, see Run-as-user for API Task (apitaskrunner).
Procedure
- Log in to Control Room.
-
Select one of the following methods on the left panel to create a schedule:
- Click Automation.
Click the actions menu (vertical ellipsis) to the right of API Task that you want to create a schedule for and click Schedule API Task.
- Click Manage > Scheduled > Create schedule.
The Automation and dependencies screen is displayed. You can also click the Choose option to find the specific API Task. - Click Automation.
-
Select the API Task that you want to schedule and click
Choose.
The Create schedule screen with various tabs is displayed.
-
Use the Automation and dependencies tab to review and update
the following fields:
- Automation file: Displays the selected API Task.
If you want to select a different API Task, click Choose.
- Run automation and dependencies using: Select one of
the following versions of the API Task to run:
- Latest version: Schedules the selected API Task and the dependencies using the most recent version.
- Production label: Schedules the selected API Task and the dependencies using the production version.
By default, the latest version of the API Task is selected.
- Dependencies: List of dependencies for the selected API Task.
- Automation file: Displays the selected API Task.
- Click Next.
-
Add the scheduling details to the API Task.
In the Schedule field, select one of the following options:
- Run once: Runs the API Task one time at
the specified day and hour.
Use the following options to configure the Run once setting:
- Start date: Default value is the current day.
- Start time: Default value is rounded up to the next half-hour.
- Time zone: System time zone on your local device.
- Run repeatedly: Use this option to schedule your API Task to run at the specified time on a given day.
Use the following options to configure the Run repeatedly setting:
- Start date: Enter the date when you want the
schedule to start running the API Task.
Enter the date either manually in YYYY-MM-DD format or by using the pop-up calendar. The default value of the Start date field is set to the current day that is set on your local device.
- End date: Enter the date when you want the
schedule to end.
The End date will not be set by default.
- Start time: Enter the Start
time using the drop-down list to set the time value when
you want your schedule to start.
The list contains predefined time values in the 12-hour format at intervals of 15 minutes. You can also manually set the time value in the 12-hour format.
- Time zone: Select the time zone for both the
start and end time.
The default value is set to the current location your system. A schedule is run based on the time zone selected when creating or editing a schedule.
- Repeat every: Select this option to repeat the schedule.
- Start date: Enter the date when you want the
schedule to start running the API Task.
- Frequency: Select one of the following options as the
frequency for the schedule to run:
- Daily: Select the number of days you want the schedule to run.
- Weekly: Select the weeks and the particular days
of the week you want the schedule to run.
For example, if you want the schedule to run every 2 weeks on Monday and Thursday, increase the count to 2 in the Every option and select the Monday and Thursday check boxes .
- Monthly: Select one of the following options:
- Day: Select the day of the months you want the schedule to run.
- The: Select a particular occurrence of the
day of the months you want the schedule to run.
For example, if you want the schedule to run on the second Thursday of January, May, and September, then select Second, Thursday, and January, May, and September from the given options.
Note: When daylight saving is enabled and if the Start date is scheduled, the date is shown in the time zone to which it belongs to (not per the user's current time zone). However, Next occurrence is shown in the time zone (user's system time zone) per daylight saving time.For example, for a schedule created on 15 March in GMT time zone, the Start date is shown as Mar-15th, which belongs to the GMT time zone. Later, when daylight saving is ON and if you edit or view this schedule in the month of August in BST time zone, the next occurrence is shown as August which belongs to the BST time zone.
If you schedule the task to run from 23/11/2023 9:00 AM to 30/11/2023 9:00 AM, with the frequency set as daily, the task executes daily from 23/11/2023 9 AM and the last task is executed on 30/11/2023 9 AM.
- In the Missed schedule setting section, select the
Redeploy the schedule again check box to redeploy a
schedule that was missed because of any Control Room
shutdown.
When the Redeploy the schedule again option is selected, schedules missed because of any Control Room shutdown are automatically redeployed after the Control Room is restarted. An audit log entry is also added showing the Event type as
Schedule misfired
.Note: To ensure a successful deployment when using the Redeploy the schedule again option, you must start the compiler service before you restart the Control Room services.
- Run once: Runs the API Task one time at
the specified day and hour.
- Click Next.
-
Use the Run-as users tab for the following:
- Select the users from the list of Available run-as
users table and click the down arrow to add your
selection.
The users that you have selected are listed in the Selected table. You can use the up arrow to remove any of the selected users.
Note: System generates a user called apitaskrunner who is associated with the AAE_API Task Runner role to establish the run-as user context for API Tasks. - In the Define number of run-as users to
use field, choose one of the following:
- All run-as users: Select this option to specify all the users available in the Selected table as run-as users while executing the API Task.
- Custom number of run-as users: Select this option
to provide a certain number of users from the
Selected table that you want to use as run-as
users.
For example, if you have 5 users in the Selected table, and you only want to use 3 as run-as users, enter 3. The 3 users listed at the top of the table are used as run-as users while executing the API Task.
- Select the users from the list of Available run-as
users table and click the down arrow to add your
selection.
- Click Next.
- Optional:
Use the General tab to change the default settings for the
following options:
- Activity name: Edit or rename the API Task.
- Automation priority: Click the drop-down menu to set
the automation priority.
Medium is the default automation priority, but you can change this so that automations are processed for deployment accordingly.
-
Click Create schedule.
The API Task is scheduled. You can view the status of the scheduled API Tasks in the Manage > Scheduled page.