Skip to content
Roboto
Esc
↑↓navigate↵open⌘Jpreview
On this page

roboto.domain.actions.scheduled_trigger

Module Contents

ScheduledTrigger

class roboto.domain.actions.scheduled_trigger.ScheduledTrigger(record, roboto_client=None)#View Source

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.

Properties

ScheduledTrigger.action_reference

Reference to the action this trigger invokes.

ScheduledTrigger.compute_requirement_overrides

compute_requirement_overrides roboto.domain.actions.action_record.ComputeRequirements | None #

Optional compute requirement overrides.

ScheduledTrigger.container_parameter_overrides

container_parameter_overrides roboto.domain.actions.action_record.ContainerParameters | None #

Optional container parameter overrides.

ScheduledTrigger.create()

classmethod create(name, schedule, action_name, action_owner_id=None, compute_requirement_overrides=None, container_parameter_overrides=None, enabled=True, invocation_input=None, invocation_upload_destination=None, parameter_values=None, timeout=None, caller_org_id=None, roboto_client=None)#View Source

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 str

Unique name for the scheduled trigger. Must not exceed 256 characters.

schedule Union[str, TriggerSchedule]

Recurring schedule for the trigger, e.g. hourly.

action_name str

Name 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.domain.actions.action_record.ComputeRequirements]

Optional compute requirement overrides for action invocations.

container_parameter_overrides Optional[roboto.domain.actions.action_record.ContainerParameters]

Optional container parameter overrides for action invocations.

enabled bool

Whether the trigger should be active immediately after creation.

Optional input specification to be used for all scheduled action invocations.

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.http.RobotoClient]

Roboto client instance. If not provided, defaults to the caller’s Roboto configuration.

Returns

The newly created ScheduledTrigger instance.

Raises

ValueError

If 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'"),
)

Properties

ScheduledTrigger.created

created datetime.datetime #

Creation time for this scheduled trigger.

Return type: datetime.datetime

ScheduledTrigger.created_by

created_by str #

User who created this scheduled trigger.

Return type: str

ScheduledTrigger.delete()

delete()#View Source

Delete this scheduled trigger.

Return type

None

ScheduledTrigger.disable()

disable()#View Source

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

None

ScheduledTrigger.enable()

enable()#View Source

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

bool

True if the trigger is now enabled, False otherwise.

Properties

ScheduledTrigger.enabled

enabled bool #

True if this scheduled trigger is enabled.

Return type: bool

ScheduledTrigger.from_id()

classmethod from_id(trigger_id, owner_org_id=None, roboto_client=None)#View Source

Fetch a scheduled trigger by its unique ID.

Parameters

trigger_id str

Unique trigger ID.

owner_org_id Optional[str]

Organization ID which owns the trigger. Defaults to caller’s org.

roboto_client Optional[roboto.http.RobotoClient]

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()

classmethod from_name(name, owner_org_id=None, roboto_client=None)#View Source

Fetch a scheduled trigger by its unique name within an organization.

Parameters

name str

Name of the scheduled trigger.

owner_org_id Optional[str]

Organization ID which owns the trigger. Defaults to caller’s org.

roboto_client Optional[roboto.http.RobotoClient]

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_action()#View Source

Get the target Action for this scheduled trigger.

Returns

The action this trigger invokes on a recurring schedule.

ScheduledTrigger.get_evaluations()

get_evaluations()#View Source

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_invocations()#View Source

Get the scheduled invocations initiated by this trigger, if any.

Returns

collections.abc.Generator[roboto.domain.actions.invocation.Invocation, None, None]

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

Optional upload destination for action invocation outputs.

ScheduledTrigger.modified

modified datetime.datetime #

Last modification time for this scheduled trigger.

Return type: datetime.datetime

ScheduledTrigger.modified_by

modified_by str #

User who last modified this scheduled trigger.

Return type: str

ScheduledTrigger.name

name str #

This trigger’s name, unique among scheduled triggers in the org.

Return type: str

ScheduledTrigger.org_id

org_id str #

Organization ID which owns this scheduled trigger.

Return type: str

ScheduledTrigger.parameter_values

parameter_values dict[str, Any] | None #

Optional action parameter values.

Return type: Optional[dict[str, Any]]

ScheduledTrigger.record

Wire-transmissible representation of this scheduled trigger.

ScheduledTrigger.schedule

schedule str #

Invocation schedule for the target action.

Return type: str

ScheduledTrigger.timeout

timeout int | None #

Optional invocation timeout, in minutes.

Return type: Optional[int]

ScheduledTrigger.trigger_id

trigger_id str #

Unique ID of the scheduled trigger.

Return type: str

ScheduledTrigger.update()

update(action_name=NotSet, action_owner_id=NotSet, compute_requirement_overrides=NotSet, container_parameter_overrides=NotSet, enabled=NotSet, invocation_input=NotSet, invocation_upload_destination=NotSet, parameter_values=NotSet, schedule=NotSet, timeout=NotSet)#View Source

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.sentinels.NotSetType]

Name of the target action to associate with this trigger.

action_owner_id Union[str, roboto.sentinels.NotSetType]

Organization ID that owns the target action.

Optional compute requirement overrides for action invocations.

Optional container parameter overrides for action invocations.

enabled Union[bool, roboto.sentinels.NotSetType]

Whether the trigger should be active immediately after creation.

Optional input specification to be used for all scheduled action invocations.

Optional upload destination for invocation outputs.

parameter_values Union[Optional[dict[str, Any]], roboto.sentinels.NotSetType]

Optional parameter values to pass to the action when invoked.

Recurring schedule for the trigger, e.g. hourly.

timeout Union[Optional[int], roboto.sentinels.NotSetType]

Optional timeout override for action invocations, in minutes.

Returns

This trigger with any updates applied.

Raises

ValueError

If 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

class roboto.domain.actions.scheduled_trigger.TriggerSchedule(cron_string)#View Source

Utility for defining trigger schedules.

Parameters

cron_string str

TriggerSchedule.cron()

classmethod cron(cron_string)#View Source

Create a trigger schedule based on a Cron expression.

Parameters

cron_string str

A Cron expression like */30 * * * *.

Raises

ValueError

If the provided string is not a valid Cron expression.

Properties

TriggerSchedule.cron_string

cron_string str #

Cron string representing the schedule.

Return type: str

TriggerSchedule.daily()

classmethod daily()#View Source

Every day at midnight UTC.

Return type

TriggerSchedule.hourly()

classmethod hourly()#View Source

Every hour on the hour.

Return type

TriggerSchedule.monthly()

classmethod monthly()#View Source

Every 1st of the month at midnight UTC.

Return type

TriggerSchedule.weekly()

classmethod weekly()#View Source

Every Sunday at midnight UTC.

Return type

Was this page helpful?