Get Schedules Hierarchy

Description

'Get Schedules Hierarchy' returns a list of all the details of the scheduler along with its hierarchy in the Leapwork studio, so that you can identify which schedule belongs to which run list, and under what folder. The hierarchy gets displayed up to 10 folder levels from the schedule (active or disabled), which is  present in the Leapwork studio ‘Run Lists’ section.

This endpoint is available for all editions of Leapwork, and can be accessed with an access key that has an integrations scope.

Request URL

(GET) http://{controllerMachine}:{controllerPort}/api/v4/schedules/hierarchy

Input parameters

Field Type Description Comment
accessKey string An access key is required to restrict unauthorized access to the API. The Access Key should include Integrations scope to access the API.

 

Examples

Curl

curl -X GET --header 'Accept: application/json' --header 'accessKey: RPqwNoQTn38dERIC' 'http://localhost:9001/api/v4/schedules/hierarchy'

PowerShell 

$headers = @{}
$headers.Add("
accessKey","RPqwNoQTn38dERIC")
Invoke-WebRequest -Uri "
http://localhost:9001/api/v4/schedules/hierarchy" -ContentType "application/json" -Headers $headers -Method GET

Response

Schedule details along with its hierarchy is returned in the JSON response.

[

{

   "ScheduleHierarchy": {

     "Id": "c7476922-cc9d-4b45-9a0e-8955c8202f29",

     "Title": "S1",

     "Type": "ScheduleInfo",

     "Parent": [

       {

         "$id": "1",

         "Id": "6fa1c30b-140c-4837-82c4-f079cdbdbd18",

         "Title": "New Run list 1",

         "Type": "RunList",

         "Parent": [

           {

             "$id": "2",

             "Id": "8c8d8e2b-4cdb-4859-b2e6-a257cca24282",

             "Title": "New Folder 1",

             "Type": "Folder",

             "Parent": []

           }

         ]

       }

     ]

   },

   "ScheduleInfo": {

     "RunListSteps": [

       {

         "$id": "3",

         "Id": "e858d71e-8375-46f0-a3a1-e28f9183a73a",

         "RunListStepId": "3db3b98b-aaed-46de-a645-81da7d6d9991",

         "ScheduleInfoId": "c7476922-cc9d-4b45-9a0e-8955c8202f29",

         "StepIndex": 0,

         "StepName": "Step 1",

         "StepStartCondition": "Always",

         "EnvironmentParallelization": "RunAllFlows",

         "StartOrder": "Defined",

         "Agents": [

           {

             "$id": "4",

             "AgentId": "1a8d0f39-ce50-4a35-bed1-770b4de3f957",

             "AgentTitle": "Remote Agent",

             "ConnectionType": "RemoteAgent"

           }

         ]

       }

     ],

     "Team": {

       "$id": "5",

       "Id": "9fb4ef50-6924-471d-8261-052aa8b572c9",

       "Title": "Team 1"

     },

     "RunListInfoId": "6fa1c30b-140c-4837-82c4-f079cdbdbd18",

     "IsEnabled": true,

     "IsScheduled": false,

     "StartDateTime": {

      "$id": "6",

       "Value": "2022-05-25T13:48:00+00:00",

       "LocalDateTime": "2022-05-25T19:18:00",

       "UtcDateTime": "2022-05-25T13:48:00",

       "Ticks": 637890832800000000

     },

     "AlreadyRunningBehavior": "QueueNextRun",

     "AgentBusyBehavior": "QueueNextRun",

     "ReserveAgentsStrategy": "ReserveAllAgentsForStepBeforeStartingStep",

     "IsStopIfFlowFailed": false,

     "FlowFailedCount": 1,

     "IsDisableScheduleIfFlowFailed": false,

     "FlowFailedCountToDisableSchedule": 1,

     "IsStopIfLateness": false,

     "EstimatedRunTimePrecision": 25,

     "IsStopAfterElapsedInterval": false,

     "StopIntervalMinutes": 1,

     "TimeZoneOffset": 198000000000,

     "TimeZoneId": "India Standard Time",

     "InternalVersion": 1,

     "CreatedBy": "db5a792e-374d-4bac-8067-441ab87a33b2",

     "ModifiedBy": "db5a792e-374d-4bac-8067-441ab87a33b2",

     "DateCreation": {

       "$id": "7",

       "Value": "2022-05-25T08:18:46.2247124+00:00",

       "LocalDateTime": "2022-05-25T13:48:46.2247124",

       "UtcDateTime": "2022-05-25T08:18:46.2247124",

       "Ticks": 637890635262247200

     },

     "DateModify": {

       "$id": "8",

        "Value": "2022-05-25T08:18:46.2247124+00:00",

       "LocalDateTime": "2022-05-25T13:48:46.2247124",

       "UtcDateTime": "2022-05-25T08:18:46.2247124",

       "Ticks": 637890635262247200

     },

     "Title": "S1",

     "Type": "ScheduleInfo",

     "IsDeleted": false,

     "Id": "c7476922-cc9d-4b45-9a0e-8955c8202f29"

   }

}

]

Response object

Field

Type

Description

Values

$id

string

ID of internal object

 N/A

ScheduleHierarchy

object

List all the information about the parent hierarchy from the schedule

Id, Title, Type, Parent

Id

string

Unique Id of the Schedule/RunList/Folder

 

Title

string

Name of the Schedule/RunList/Folder

 

Type

string

Type inside hierarchy

Schedule/RunList/Folder

Parent

object

Parent recursive object inside hierarchy of Schedule/RunList/Folder

Id, Title, Type, Parent

ScheduleInfo

object

List all the information about the schedule

 

Id

string

Unique Id of the Schedule (ScheduleId)

 

IsEnabled

bool

Is schedule Enabled/Disable status

true | false

IsScheduled

bool

Trigger of schedule

·       True: Scheduled

·       False: OnDemand

true | false

AlreadyRunningBehavior

string

Behavior when schedule is already running

QueueNextRun, SkipNextRun, StopCurrentStartNextRun

AgentBusyBehavior

string

Behavior when agent is busy

QueueNextRun, SkipNextRun, StopCurrentStartNextRun

ReserveAgentsStrategy

string

Strategy used to reserve agents for run list steps

ReserveAllAgentsForStepBeforeStartingStep, ReserveAllAgentsForAllStepsBeforeStartingSchedule

IsStopIfFlowFailed

bool

Flag to stop if flow failed

true | false

FlowFailedCount

number

Count of failed flow

 

IsDisableScheduleIfFlowFailed

bool

Flag to stop and disable schedule if flow failed

true | false

FlowFailedCountToDisableSchedule

number

Count of failed flow to stop and disable schedule

 

IsStopIfLateness

bool

Flag to stop if run time longer than estimated

true | false

EstimatedRunTimePrecision

number

Percentage of excess of execution time overestimated to stop

 

IsStopAfterElapsedInterval

bool

Is stop if exceeding the threshold to run

true | false

StopIntervalMinutes

number

Stop interval (run threshold)

 

TimeZoneOffset

number

Time zone offset based on local time ticks

 

TimeZoneId

string

Local time zone id

 

InternalVersion

number

Schedule internal version

 

CreatedBy

string

Unique Id of the user who created schedule

 

ModifiedBy

string

Unique Id of the user who modified schedule

 

DateCreation

object

Schedule creation date

Value, LocalDateTime, UtcDateTime, Ticks

DateModify

object

Schedule modification date

Value, LocalDateTime, UtcDateTime, Ticks

Title

string

Name of the Schedule

 

Type

string

Define type of schedule

ScheduleInfo

IsDeleted

bool

Deleted schedule or not

true | false

RunListInfoId

string

Run list info Id of schedule

 

RunListSteps

object

Run list steps information

RunListStepId, ScheduleInfoId, StepIndex, StepName, StepStartCondition, EnvironmentParallelization, StartOrder, Agents

RunListStepId

string

Run list step ID of schedule

 

ScheduleInfoId

string

Schedule Id

 

StepIndex

number

Run list step index

 

StepName

string

Run list step name

 

StepStartCondition

string

Start condition of the run list step

Run step based on conditions:

Always, OnlyPreviousStepSuccess, OnlyAllPreviousStepSuccess, AnyPreviousStepFailed

EnvironmentParallelization

string

Run condition for flows in a step

RunAllFlows, RunFlowsOnce, RunFlowsOnFirstAvailableAgent

StartOrder

string

Start order of run list step

Defined, Random

Agents

object

Agent details on a schedule

AgentId, AgentTitle, ConnectionType

Team

object

Scheduler team details

Id and Title of team

Response Code

200 (OK)

401 (Unauthorized - eg: “Incorrect Accesskey”)

403 (Forbidden – eg: “AccessKey does not have the relevant scope permission”)

500 (Internal Server Error)