roboto.domain.actions.scheduled_trigger
Module Contents
ScheduledTrigger
A trigger that invokes actions on a recurring schedule, e.g. hourly or daily.
Schedules are currently specified using standard Cron expressions, with times in UTC. A handful of common schedules are provided by the TriggerSchedule class.
Once a scheduled time is reached, the action associated with this trigger will be invoked using the optionally provided input specification, and any other overrides such as compute requirements or parameter values.
Parameters
roboto_client Optional[roboto.Properties
ScheduledTrigger.action_reference
Reference to the action this trigger invokes.
ScheduledTrigger.compute_requirement_overrides
Optional compute requirement overrides.
ScheduledTrigger.container_parameter_overrides
Optional container parameter overrides.
ScheduledTrigger.create()
Create a new scheduled trigger.
If the trigger is enabled on creation, action invocations will commence on the provided schedule. Note that the total number of active triggers in an organization is subject to a tier-specific limit. Exceeding that limit will result in the trigger being disabled.
Parameters
name strUnique name for the scheduled trigger. Must not exceed 256 characters.
schedule Union[str, TriggerSchedule]Recurring schedule for the trigger, e.g. hourly.
action_name strName of the action to invoke on schedule.
action_owner_id Optional[str]Organization ID that owns the target action. If not provided, searches the caller’s organization.
compute_requirement_overrides Optional[roboto.Optional compute requirement overrides for action invocations.
container_parameter_overrides Optional[roboto.Optional container parameter overrides for action invocations.
enabled boolWhether the trigger should be active immediately after creation.
invocation_input Optional[roboto.Optional input specification to be used for all scheduled action invocations.
invocation_upload_destination Optional[roboto.Optional upload destination for invocation outputs. Currently supports datasets.
parameter_values Optional[dict[str, Any]]Optional parameter values to pass to the action when invoked.
timeout Optional[int]Optional timeout override for action invocations, in minutes.
caller_org_id Optional[str]Organization ID to create the trigger in. Defaults to caller’s org.
roboto_client Optional[roboto.Roboto client instance. If not provided, defaults to the caller’s Roboto configuration.
Returns
The newly created ScheduledTrigger instance.
Raises
ValueErrorIf request parameters have invalid values, e.g. a negative timeout.
If the request cannot be satisfied as provided.
If the caller lacks permission to create triggers, invoke the specified action or upload to the specified upload destination.
If a scheduled trigger with the provided name already exists in the target organization.
If the caller has exceeded their organization’s maximum action timeout limit (in minutes).
Usage
Create an hourly trigger to invoke an analytics action with no explicit inputs:
from roboto.domain.actions import ScheduledTrigger, TriggerSchedule
scheduled_trigger = ScheduledTrigger.create(
name="analytics_action_hourly_trigger",
action_name="analytics_action",
schedule=TriggerSchedule.hourly(),
)Create a daily trigger to invoke an action that processes CSV files created after a given date:
from roboto.domain.actions import ScheduledTrigger, TriggerSchedule, InvocationInput
scheduled_trigger = ScheduledTrigger.create(
name="csv_processor_daily_trigger",
action_name="csv_processor",
schedule=TriggerSchedule.daily(),
invocation_input=InvocationInput.file_query("created > '2025-04-05' AND path LIKE '%.csv'"),
)ScheduledTrigger.delete()
Delete this scheduled trigger.
Return type
ScheduledTrigger.disable()
Disable this scheduled trigger.
If the trigger is already disabled, the call has no effect.
Any currently running scheduled invocations will proceed to completion, but no new scheduled invocations will occur, unless and until the trigger is re-enabled.
Return type
ScheduledTrigger.enable()
Enable this scheduled trigger.
If the trigger is already enabled, the call has no effect.
The total number of active triggers within an organization is subject to a tier-specific limit. If this operation results in the limit being exceeded, this trigger will remain disabled.
Returns
True if the trigger is now enabled, False otherwise.
Properties
ScheduledTrigger.from_id()
Fetch a scheduled trigger by its unique ID.
Parameters
trigger_id strUnique trigger ID.
owner_org_id Optional[str]Organization ID which owns the trigger. Defaults to caller’s org.
roboto_client Optional[roboto.Roboto client instance. If not provided, defaults to the caller’s Roboto configuration.
Returns
The ScheduledTrigger with the provided unique ID.
Raises
If no scheduled trigger exists with the provided ID in the target organization.
If the caller is not a member of the trigger’s target organization.
ScheduledTrigger.from_name()
Fetch a scheduled trigger by its unique name within an organization.
Parameters
name strName of the scheduled trigger.
owner_org_id Optional[str]Organization ID which owns the trigger. Defaults to caller’s org.
roboto_client Optional[roboto.Roboto client instance. If not provided, defaults to the caller’s Roboto configuration.
Returns
The ScheduledTrigger with the provided unique name.
Raises
If no scheduled trigger exists with the provided name in the target organization.
If the caller is not a member of the trigger’s target organization.
ScheduledTrigger.get_action()
Get the target Action for this scheduled trigger.
Returns
The action this trigger invokes on a recurring schedule.
ScheduledTrigger.get_evaluations()
Get the evaluation history for this scheduled trigger.
Under normal circumstances, this trigger’s target action will simply be invoked on the configured schedule, for as long as the trigger is enabled. However, it’s possible that an error occurs when attempting to invoke the action. In either case, a trigger evaluation record is created to capture the details of what happened.
Returns
A generator that yields TriggerEvaluationRecord instances, ordered by descending evaluation start time.
ScheduledTrigger.get_invocations()
Get the scheduled invocations initiated by this trigger, if any.
Returns
A generator that yields Invocation instances for any scheduled invocations kicked off by this trigger. The invocations are ordered from most to least recently created.
Properties
ScheduledTrigger.invocation_input
Optional input specification for action invocations.
ScheduledTrigger.invocation_upload_destination
invocation_upload_destination roboto.Optional upload destination for action invocation outputs.
ScheduledTrigger.modified
Last modification time for this scheduled trigger.
ScheduledTrigger.modified_by
User who last modified this scheduled trigger.
ScheduledTrigger.name
This trigger’s name, unique among scheduled triggers in the org.
ScheduledTrigger.org_id
Organization ID which owns this scheduled trigger.
ScheduledTrigger.parameter_values
Optional action parameter values.
ScheduledTrigger.record
Wire-transmissible representation of this scheduled trigger.
ScheduledTrigger.timeout
Optional invocation timeout, in minutes.
ScheduledTrigger.update()
Update this scheduled trigger.
Changing the action associated with this trigger, or the default upload destination, are subject to authorization checks. Enabling the trigger or changing the target action’s timeout are subject to tier-specific organization limit checks.
Per Roboto convention, the sentinel value NotSet is the default for all arguments to this call, indicating that the corresponding trigger attribute should not be updated. The value None, on the other hand, indicates that the relevant trigger attribute should be set to None (i.e. cleared).
Parameters
action_name Union[str, roboto.Name of the target action to associate with this trigger.
action_owner_id Union[str, roboto.Organization ID that owns the target action.
compute_requirement_overrides Union[Optional[roboto.Optional compute requirement overrides for action invocations.
container_parameter_overrides Union[Optional[roboto.Optional container parameter overrides for action invocations.
enabled Union[bool, roboto.Whether the trigger should be active immediately after creation.
invocation_input Union[Optional[roboto.Optional input specification to be used for all scheduled action invocations.
invocation_upload_destination Union[Optional[roboto.Optional upload destination for invocation outputs.
parameter_values Union[Optional[dict[str, Any]], roboto.Optional parameter values to pass to the action when invoked.
schedule Union[str, TriggerSchedule, roboto.Recurring schedule for the trigger, e.g. hourly.
timeout Union[Optional[int], roboto.Optional timeout override for action invocations, in minutes.
Returns
This trigger with any updates applied.
Raises
ValueErrorIf request parameters have invalid values, e.g. a negative timeout.
If the request cannot be satisfied as provided.
If the caller lacks permission to invoke the specified action or upload to the specified upload destination.
If the caller has exceeded their organization’s maximum action timeout limit (in minutes).
TriggerSchedule
Utility for defining trigger schedules.
Parameters
cron_string strTriggerSchedule.cron()
Create a trigger schedule based on a Cron expression.
Parameters
cron_string strA Cron expression like */30 * * * *.
Returns
A TriggerSchedule instance.
Raises
ValueErrorIf the provided string is not a valid Cron expression.
Properties
TriggerSchedule.daily()
Every day at midnight UTC.
Return type
TriggerSchedule.hourly()
Every hour on the hour.
Return type
TriggerSchedule.monthly()
Every 1st of the month at midnight UTC.
Return type
TriggerSchedule.weekly()
Every Sunday at midnight UTC.
Return type