Read and Review Automation Anywhere Documentation

Automation 360

Close Contents

Contents

Open Contents

Schedule bot to run API

  • Updated: 8/10/2021
    • Automation 360 v.x
    • Explore
    • RPA Workspace

Schedule bot to run API

Schedule a bot to run on an unattended Bot Runner either one time or on a recurring basis.

Prerequisites

Note: You can view the Control Room APIs in the Community Edition, but API functionality is limited. You need a licensed Automation 360 Edition to access the full functionality of the APIs.
  • Use the Authentication API to generate a JSON Web Token. See Authentication API.
  • Ensure that you are allocated the following resources:
    • View and Run my bots feature permission
    • Run and schedule permissions for the folders that contain the bots
    • Access to Bot Runner licensed users
    • Access to either a default device or a device pool
      Note: If the user associated with the Bot Runner license has a default device assigned to their account, the bot deploys on that device. If no default device is assigned, or you want to select a different device, then you must specify a device pool.

To schedule a bot, you provide the following information to the API:

Parameter Required Type Description
fileId Yes Number Identifier for the bot. List files and folders by workspace API
runAsUserIds Yes Number Identifier for a user that is registered with your Control Room as an Unattended bot runner. List available unattended Bot Runners API
status Yes String Indicates whether to create an active or draft schedule. Enter either ACTIVE or DRAFT.
poolIds No Number Identifier of a device pool that has at least one active device.
Note: If the user associated with the Bot Runner license has a default device assigned to their account, the bot deploys on that device. If no default device is assigned, or you want to select a different device, then you must specify a device pool.
List device pools API

Procedure

  1. Add the authentication token to the request header.
  2. Use the POST method and endpoint URL: <control_room_url>/v1/schedule/automations.
    Request body:
    This example request body contains the required parameters to schedule a bot to run one time.
    {
       "name":"UpdateInventory.20.12.16.10.40.48",
       "fileId":14277,
       "poolIds":[
          "27"
       ],
       "timeZone":"Asia/Calcutta",
       "runAsUserIds":[
          "472",
          "480",
          "80"
       ],
       "startDate":"2020-12-16",
       "startTime":"15:00",
       "scheduleType":"NONE",
       "status":"ACTIVE"
       }
    This example request body contains the required parameters to schedule a bot to run on a recurring basis.
    {
       "name":"UpdateInventory.20.12.16.10.40.48",
       "fileId":14277,
       "poolIds":[
          "27"
       ],
       "timeZone":"Australia/Melbourne",
       "runAsUserIds":[
          "1103",
          "36",
          "80"
       ],
       "startDate":"2020-12-16",
       "repeatOccurrence":{
          "endTime":"23:59",
          "runEvery":"1",
          "timeUnit":"HOURS"
       },
       "repeatEnabled":true,
       "endDate":"2020-12-24",
       "startTime":"20:45",
       "weeklyRecurrence":{
          "interval":"1",
          "daysOfWeek":[
             "TUE",
             "THU",
             "FRI"
          ]
       },
       "scheduleType":"WEEKLY",
       "status":"ACTIVE"
    }
  3. Send the request.
    Response body: The two example responses include the following information about the automation:
    • id: the numerical value that identifies the automation. Use this parameter in the Update automations or Delete automations APIs.
    • zonedNextRunDateTime: the date and time of the next time the bot is scheduled to run.
    This is an example response for a bot scheduled to run one time.
    {
        "id": "989",
        "name": "UpdateInventory.20.12.16.10.40.48",
        "fileId": 14277,
        "status": "ACTIVE",
        "deviceIds": [],
        "description": "",
        "rdpEnabled": false,
        "scheduleType": "NONE",
        "timeZone": "Asia/Calcutta",
        "startDate": "2021-12-16",
        "endDate": "",
        "startTime": "15:00",
        "repeatEnabled": false,
        "zonedNextRunDateTime": "2021-12-16T09:30:00Z",
        "createdBy": "1103",
        "createdOn": "2021-01-11T18:57:18.932407Z",
        "updatedBy": "1103",
        "updatedOn": "2021-01-11T18:57:18.932422Z",
        "tenantId": "1",
        "fileName": "appsheet",
        "filePath": "Automation Anywhere\\Bots\\appsheet",
        "runAsUserIds": [
            "480",
            "80",
            "472"
        ],
        "botInput": {},
        "tenantUuid": "e100fbce-008c-04ec-4063-7af0af91fb2f",
        "poolId": [
            "11"
        ],
        "overrideDefaultDevice": false,
        "runElevated": false
    }
    This is an example response for a bot scheduled to run on a recurring basis.
    {
        "id": "990",
        "name": "UpdateInventory.20.12.16.10.40.48",
        "fileId": 14277,
        "status": "ACTIVE",
        "deviceIds": [],
        "description": "",
        "rdpEnabled": false,
        "scheduleType": "WEEKLY",
        "weeklyRecurrence": {
            "interval": 1,
            "daysOfWeek": [
                "TUE",
                "THU",
                "FRI"
            ]
        },
        "timeZone": "Australia/Melbourne",
        "startDate": "2021-01-16",
        "endDate": "2021-12-24",
        "startTime": "20:45",
        "repeatEnabled": true,
        "repeatOccurrence": {
            "runEvery": "1",
            "timeUnit": "HOURS",
            "endTime": "23:59"
        },
        "zonedNextRunDateTime": "2021-01-19T09:45:00Z",
        "createdBy": "1103",
        "createdOn": "2021-01-11T18:59:31.182663Z",
        "updatedBy": "1103",
        "updatedOn": "2021-01-11T18:59:31.182669Z",
        "tenantId": "1",
        "fileName": "a_trigger",
        "filePath": "Automation Anywhere\\Bots\\a_trigger",
        "runAsUserIds": [
            "80",
            "36",
            "1103"
        ],
        "botInput": {},
        "tenantUuid": "e100fbce-008c-04ec-4063-7af0af91fb2f",
        "poolId": [
            "7"
        ],
        "overrideDefaultDevice": false,
        "runElevated": false
    } 
    The REST API responds to each request with an HTTP response code. For response codes, see API response codes.

Next steps

Use the List automation schedules API to retrieve details on all the scheduled automations.
Send Feedback