When an automation should executed periodically and not in direct relation to a specific action, it can be triggered based on a schedule. When executed on a schedule, the automation will execute on the job server.
Triggering Automations using a Schedule
To enable an automation to be executed periodically on a schedule,
- On the automation's Overview, locate Triggers, and check Scheduled.
- Select the schedule type from the drop-down and provide details required by the schedule type.
Using Scheduled Triggers in Automation Implementations
Each enabled instance of a scheduled automation will appear in the jobs listing (Administration > Monitoring > Jobs) with its next execution time. When the scheduled execution time occurs, the automation is executed. When the automation completes, its next scheduled time will be calculated and the job listing will be updated to reflect the automation's next execution time. When executed manually, details about the schedule are provided through the context_v2_automationTrigger
API:
- Entity. For scheduled triggers, the Entity is always "Job"
- Event. For scheduled triggers, the Event is always "Executed"
- Arguments. For scheduled triggers, Arguments provides two properties:
- IsCancellationRequested. Automations run on a schedule are allowed to run for an extended period of time on the job server. If the job server requests that the current task end, the IsCancellationRequested argument will change to true. For long running automations, this property should be checked periodically and the process should be cancelled if possible when it is set to true.
- Schedule. The current configured schedule for the automation. This is for reference to enable the automation to know roughly how frequently it is executed.