---
sidebar:
  hidden: true
title: roboto.domain.actions.scheduled_trigger
---
## Module Contents

### ScheduledTrigger

```python
class roboto.domain.actions.scheduled_trigger.ScheduledTrigger(
    record: roboto.domain.actions.scheduled_trigger_record.ScheduledTriggerRecord,
    roboto_client: Optional[roboto.http.RobotoClient] = None,
)
```

`from roboto.domain.actions import ScheduledTrigger`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L112-L624)

Deprecated. A trigger that invokes an action on a recurring schedule, such as hourly or daily.

Use [`Trigger`](/docs/reference/python-sdk/roboto/domain/triggers/trigger#roboto.domain.triggers.trigger.Trigger) instead, which reads and edits every trigger; pass `schedule` to [`create()`](/docs/reference/python-sdk/roboto/domain/triggers/trigger#roboto.domain.triggers.trigger.Trigger.create) to create one that runs on a schedule. This class will be removed, and constructing one emits a `DeprecationWarning`. It reads and edits only triggers that run on a schedule and invoke one action: to this class, a trigger with several targets, or with an agent or Slack target, does not exist.

The schedule is a five-field cron expression evaluated in UTC; `TriggerSchedule` builds common ones. Each time the schedule comes due, the trigger invokes the latest version of its action with the trigger's input, parameter values, and overrides.

**Parameters**

- **record** (`roboto.domain.actions.scheduled_trigger_record.ScheduledTriggerRecord`)
- **roboto_client** (`Optional[roboto.http.RobotoClient]`)

**Properties**

- **ScheduledTrigger.action_reference** (`roboto.domain.actions.action_record.ActionReference`): Action the trigger invokes.

- **ScheduledTrigger.compute_requirement_overrides** (`roboto.domain.actions.action_record.ComputeRequirements | None`): Overrides of the action's compute requirements for each invocation, or `None` to use the action's own.

  Return type: `Optional[roboto.domain.actions.action_record.ComputeRequirements]`

- **ScheduledTrigger.container_parameter_overrides** (`roboto.domain.actions.action_record.ContainerParameters | None`): Overrides of the action's container parameters for each invocation, or `None` to use the action's own.

  Return type: `Optional[roboto.domain.actions.action_record.ContainerParameters]`

- **ScheduledTrigger.created** (`datetime.datetime`): Time the scheduled trigger was created.

- **ScheduledTrigger.created_by** (`str`): ID of the user who created the scheduled trigger.

- **ScheduledTrigger.enabled** (`bool`): Whether the trigger invokes the action on its schedule.

- **ScheduledTrigger.invocation_input** (`roboto.domain.actions.invocation_record.InvocationInput | None`): Input each invocation receives, or `None` if invocations take no input.

  Return type: `Optional[roboto.domain.actions.invocation_record.InvocationInput]`

- **ScheduledTrigger.invocation_upload_destination** (`roboto.domain.actions.invocation_record.InvocationUploadDestination | None`): Where each invocation uploads its output files, or `None` if the trigger sets no destination.

  Return type: `Optional[roboto.domain.actions.invocation_record.InvocationUploadDestination]`

- **ScheduledTrigger.modified** (`datetime.datetime`): Time the scheduled trigger was last modified.

- **ScheduledTrigger.modified_by** (`str`): ID of the user who last modified the scheduled trigger.

  [`modified_by`](/docs/reference/python-sdk/roboto/domain/actions/scheduled_trigger_record#roboto.domain.actions.scheduled_trigger_record.ScheduledTriggerRecord.modified_by) says when it is Roboto's own system user.

- **ScheduledTrigger.name** (`str`): Human-readable name of the scheduled trigger, unique within its organization.

- **ScheduledTrigger.org_id** (`str`): ID of the organization that owns the scheduled trigger.

- **ScheduledTrigger.parameter_values** (`dict[str, Any] | None`): Values for the action's parameters, keyed by parameter name, or `None` if the trigger sets none.

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

- **ScheduledTrigger.record** (`roboto.domain.actions.scheduled_trigger_record.ScheduledTriggerRecord`): Record of the scheduled trigger that this instance holds.

  `update` replaces it with Roboto's response.

- **ScheduledTrigger.schedule** (`str`): Cron expression, in UTC, for when the trigger invokes the action, such as `"0 * * * *"` for every hour.

- **ScheduledTrigger.timeout** (`int | None`): Timeout of each invocation, in minutes, or `None` to use the action's own.

  Return type: `Optional[int]`

- **ScheduledTrigger.trigger_id** (`str`): Unique ID of the scheduled trigger.

#### ScheduledTrigger.create()

```python
@classmethod
def create(
    name: str,
    schedule: Union[str, TriggerSchedule],
    action_name: str,
    action_owner_id: Optional[str] = None,
    compute_requirement_overrides: Optional[roboto.domain.actions.action_record.ComputeRequirements] = None,
    container_parameter_overrides: Optional[roboto.domain.actions.action_record.ContainerParameters] = None,
    enabled: bool = True,
    invocation_input: Optional[roboto.domain.actions.invocation_record.InvocationInput] = None,
    invocation_upload_destination: Optional[roboto.domain.actions.invocation_record.InvocationUploadDestination] = None,
    parameter_values: Optional[dict[str, Any]] = None,
    timeout: Optional[int] = None,
    caller_org_id: Optional[str] = None,
    roboto_client: Optional[roboto.http.RobotoClient] = None,
) -> ScheduledTrigger
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L130-L238)

Create a scheduled trigger.

When `enabled` is `True` and the organization is already at its limit on enabled triggers, Roboto creates the trigger disabled rather than failing. Check `enabled` on the result.

**Parameters**

- **name** (`str`): Human-readable name of the trigger, unique within its organization. At most 256 characters, of letters, digits, underscores, and hyphens.
- **schedule** (`Union[str, TriggerSchedule]`): When the trigger invokes the action: a five-field cron expression evaluated in UTC, or a `TriggerSchedule`.
- **action_name** (`str`): Name of the action to invoke. The trigger invokes the action's latest version.
- **action_owner_id** (`Optional[str]`): ID of the organization that owns the action. `None` uses the organization the trigger is created in. An action another organization owns must be published in Action Hub.
- **compute_requirement_overrides** (`Optional[roboto.domain.actions.action_record.ComputeRequirements]`): Overrides of the action's compute requirements for each invocation. `None` uses the action's own.
- **container_parameter_overrides** (`Optional[roboto.domain.actions.action_record.ContainerParameters]`): Overrides of the action's container parameters for each invocation. `None` uses the action's own.
- **enabled** (`bool`): Whether the trigger invokes the action on its schedule once it is created.
- **invocation_input** (`Optional[roboto.domain.actions.invocation_record.InvocationInput]`): Query that selects each invocation's input data when the invocation runs. `None` selects none.
- **invocation_upload_destination** (`Optional[roboto.domain.actions.invocation_record.InvocationUploadDestination]`): Where each invocation uploads its output files, which must be a dataset. `None` sets none.
- **parameter_values** (`Optional[dict[str, Any]]`): Values of the action's parameters, keyed by parameter name. `None` passes none.
- **timeout** (`Optional[int]`): Maximum run time of each invocation, in minutes. `None` uses the action's own.
- **caller_org_id** (`Optional[str]`): Organization to create the trigger in. Required when the caller belongs to more than one organization; otherwise the caller's only organization.
- **roboto_client** (`Optional[roboto.http.RobotoClient]`): Client to make requests to Roboto with. Defaults to one configured from the environment, by [`from_env()`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient.from_env).

**Returns**

- `ScheduledTrigger`: The new scheduled trigger.

**Raises**

- `ValueError`: `schedule` is not a valid cron expression, `name` is longer than 256 characters or contains characters other than letters, digits, underscores, and hyphens, or `timeout` is negative.
- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): The organization that owns the action has no action named `action_name`.
- [`RobotoUnauthorizedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoUnauthorizedException): The action belongs to another organization and is not published in Action Hub, or the caller may not upload files to `invocation_upload_destination`.
- [`RobotoInvalidRequestException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoInvalidRequestException): `invocation_upload_destination` is not a dataset, or `container_parameter_overrides` is set for an action that inherits its container from another action.
- [`RobotoConflictException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoConflictException): Another trigger in the organization has this name.
- [`RobotoLimitExceededException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoLimitExceededException): `timeout` exceeds the organization's maximum action timeout.

**Usage**

Create an hourly trigger to invoke an analytics action with no explicit inputs:

```python
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 whose invocations each take the CSV files created after a given date:

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

```python
def delete() -> None
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L433-L442)

Delete the scheduled trigger.

Deleting a scheduled trigger that no longer exists succeeds and changes nothing.

**Returns**

- `None`

#### ScheduledTrigger.disable()

```python
def disable() -> None
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L444-L453)

Disable the scheduled trigger, so it starts no invocations until it is enabled again.

Invocations already running continue to completion. A trigger that is already disabled, as far as this instance's record shows, is left as it is without a request; otherwise this calls `update` with `enabled=False`.

**Returns**

- `None`

#### ScheduledTrigger.enable()

```python
def enable() -> bool
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L455-L472)

Enable the scheduled trigger, so it invokes the action on its schedule.

A trigger that is already enabled, as far as this instance's record shows, is left as it is without a request; otherwise this calls `update` with `enabled=True`.

**Returns**

- `bool`: `True`. When the trigger cannot be enabled, the call raises instead of returning `False`.

**Raises**

- [`RobotoLimitExceededException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoLimitExceededException): The organization is already at its limit on enabled triggers.
- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): The action the trigger invokes no longer exists.

#### ScheduledTrigger.from_id()

```python
@classmethod
def from_id(
    trigger_id: str,
    owner_org_id: Optional[str] = None,
    roboto_client: Optional[roboto.http.RobotoClient] = None,
) -> ScheduledTrigger
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L241-L268)

Fetch a scheduled trigger by its ID.

**Parameters**

- **trigger_id** (`str`): Unique ID of the trigger.
- **owner_org_id** (`Optional[str]`): Organization that owns the trigger. Roboto finds the trigger by its ID alone, so this can be left out.
- **roboto_client** (`Optional[roboto.http.RobotoClient]`): Client to make requests to Roboto with. Defaults to one configured from the environment, by [`from_env()`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient.from_env).

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): No trigger has this ID, or the trigger does not run on a schedule, or it has more than one target or a target that does not invoke an action.

**Returns**

- `ScheduledTrigger`

#### ScheduledTrigger.from_name()

```python
@classmethod
def from_name(
    name: str,
    owner_org_id: Optional[str] = None,
    roboto_client: Optional[roboto.http.RobotoClient] = None,
) -> ScheduledTrigger
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L271-L298)

Fetch a scheduled trigger by its name, which is unique within its organization.

**Parameters**

- **name** (`str`): Name of the trigger.
- **owner_org_id** (`Optional[str]`): Organization that owns the trigger. Required when the caller belongs to more than one organization; otherwise the caller's only organization.
- **roboto_client** (`Optional[roboto.http.RobotoClient]`): Client to make requests to Roboto with. Defaults to one configured from the environment, by [`from_env()`](/docs/reference/python-sdk/roboto/http/roboto_client#roboto.http.roboto_client.RobotoClient.from_env).

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): The organization has no trigger with this name, or the trigger does not run on a schedule, or it has more than one target or a target that does not invoke an action.

**Returns**

- `ScheduledTrigger`

#### ScheduledTrigger.get_action()

```python
def get_action() -> roboto.domain.actions.action.Action
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L474-L485)

Fetch the latest version of the [`Action`](/docs/reference/python-sdk/roboto/domain/actions/action#roboto.domain.actions.action.Action) the trigger invokes.

**Raises**

- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): The action no longer exists.

**Returns**

- `roboto.domain.actions.action.Action`

#### ScheduledTrigger.get_evaluations()

```python
def get_evaluations() -> collections.abc.Generator[roboto.domain.actions.trigger_record.TriggerEvaluationRecord, None, None]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L487-L519)

Yield a record of each time the trigger came due and tried to invoke the action, newest first.

Each [`TriggerEvaluationRecord`](/docs/reference/python-sdk/roboto/domain/actions/trigger_record#roboto.domain.actions.trigger_record.TriggerEvaluationRecord) says when the attempt started and ended and whether it invoked the action. Records are fetched 100 at a time, as the iteration reaches them.

**Returns**

- `collections.abc.Generator[roboto.domain.actions.trigger_record.TriggerEvaluationRecord, None, None]`

#### ScheduledTrigger.get_invocations()

```python
def get_invocations() -> collections.abc.Generator[roboto.domain.actions.invocation.Invocation, None, None]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L521-L542)

Yield the [`Invocation`](/docs/reference/python-sdk/roboto/domain/actions/invocation#roboto.domain.actions.invocation.Invocation) objects the trigger started, newest first.

Invocations are fetched 100 at a time, as the iteration reaches them.

**Returns**

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

#### ScheduledTrigger.update()

```python
def update(
    action_name: Union[str, roboto.sentinels.NotSetType] = NotSet,
    action_owner_id: Union[str, roboto.sentinels.NotSetType] = NotSet,
    compute_requirement_overrides: Union[Optional[roboto.domain.actions.action_record.ComputeRequirements], roboto.sentinels.NotSetType] = NotSet,
    container_parameter_overrides: Union[Optional[roboto.domain.actions.action_record.ContainerParameters], roboto.sentinels.NotSetType] = NotSet,
    enabled: Union[bool, roboto.sentinels.NotSetType] = NotSet,
    invocation_input: Union[Optional[roboto.domain.actions.invocation_record.InvocationInput], roboto.sentinels.NotSetType] = NotSet,
    invocation_upload_destination: Union[Optional[roboto.domain.actions.invocation_record.InvocationUploadDestination], roboto.sentinels.NotSetType] = NotSet,
    parameter_values: Union[Optional[dict[str, Any]], roboto.sentinels.NotSetType] = NotSet,
    schedule: Union[str, TriggerSchedule, roboto.sentinels.NotSetType] = NotSet,
    timeout: Union[Optional[int], roboto.sentinels.NotSetType] = NotSet,
) -> ScheduledTrigger
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L544-L624)

Update the scheduled trigger's properties.

Each argument left unset (`NotSet`) leaves that property unchanged.

**Parameters**

- **action_name** (`Union[str, roboto.sentinels.NotSetType]`): Name of the action to invoke. The action's owner stays the same unless `action_owner_id` is also set.
- **action_owner_id** (`Union[str, roboto.sentinels.NotSetType]`): ID of the organization that owns the action. An action another organization owns must be published in Action Hub.
- **compute_requirement_overrides** (`Union[Optional[roboto.domain.actions.action_record.ComputeRequirements], roboto.sentinels.NotSetType]`): Overrides of the action's compute requirements for each invocation. `None` clears the override, so invocations use the action's own.
- **container_parameter_overrides** (`Union[Optional[roboto.domain.actions.action_record.ContainerParameters], roboto.sentinels.NotSetType]`): Overrides of the action's container parameters for each invocation. `None` clears the override, so invocations use the action's own.
- **enabled** (`Union[bool, roboto.sentinels.NotSetType]`): Whether the trigger invokes the action on its schedule.
- **invocation_input** (`Union[Optional[roboto.domain.actions.invocation_record.InvocationInput], roboto.sentinels.NotSetType]`): Query that selects each invocation's input data when the invocation runs. `None` clears it.
- **invocation_upload_destination** (`Union[Optional[roboto.domain.actions.invocation_record.InvocationUploadDestination], roboto.sentinels.NotSetType]`): Where each invocation uploads its output files, which must be a dataset. `None` clears it.
- **parameter_values** (`Union[Optional[dict[str, Any]], roboto.sentinels.NotSetType]`): Values of the action's parameters, keyed by parameter name. `None` clears them.
- **schedule** (`Union[str, TriggerSchedule, roboto.sentinels.NotSetType]`): When the trigger invokes the action: a five-field cron expression evaluated in UTC, or a `TriggerSchedule`.
- **timeout** (`Union[Optional[int], roboto.sentinels.NotSetType]`): Maximum run time of each invocation, in minutes. `None` clears the override, so invocations use the action's own.

**Returns**

- `ScheduledTrigger`: This instance, with its record updated from Roboto's response.

**Raises**

- `ValueError`: `schedule` is not a valid cron expression, or `timeout` is negative.
- [`RobotoNotFoundException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoNotFoundException): The organization that owns the action has no action with the trigger's action name.
- [`RobotoUnauthorizedException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoUnauthorizedException): The action belongs to another organization and is not published in Action Hub, or the caller may not upload files to `invocation_upload_destination`.
- [`RobotoInvalidRequestException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoInvalidRequestException): `invocation_upload_destination` is not a dataset, or the action inherits its container from another action and the trigger sets container parameter overrides.
- [`RobotoLimitExceededException`](/docs/reference/python-sdk/roboto/exceptions/domain#roboto.exceptions.domain.RobotoLimitExceededException): The update enables the trigger and the organization is already at its limit on enabled triggers, or `timeout` exceeds the organization's maximum action timeout.

### TriggerSchedule

```python
class roboto.domain.actions.scheduled_trigger.TriggerSchedule(cron_string: str)
```

`from roboto.domain.actions import TriggerSchedule`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L54-L109)

A recurring schedule for a `ScheduledTrigger`, as a cron expression in UTC.

Build one with `cron`, which checks the expression, or with `hourly`, `daily`, `weekly` or `monthly`. The constructor does not check the expression it is given.

**Parameters**

- **cron_string** (`str`)

**Properties**

- **TriggerSchedule.cron_string** (`str`): Cron expression of the schedule, evaluated in UTC.

#### TriggerSchedule.cron()

```python
@classmethod
def cron(cron_string: str) -> TriggerSchedule
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L64-L76)

Build a schedule for a cron expression, after checking that the expression is valid.

**Parameters**

- **cron_string** (`str`): Five-field cron expression, evaluated in UTC, such as `"*/30 * * * *"` for every 30 minutes.

**Raises**

- `ValueError`: `cron_string` is not a valid cron expression.

**Returns**

- `TriggerSchedule`

#### TriggerSchedule.daily()

```python
@classmethod
def daily() -> TriggerSchedule
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L85-L88)

Build a schedule for every day at midnight UTC.

**Returns**

- `TriggerSchedule`

#### TriggerSchedule.hourly()

```python
@classmethod
def hourly() -> TriggerSchedule
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L79-L82)

Build a schedule for every hour, on the hour.

**Returns**

- `TriggerSchedule`

#### TriggerSchedule.monthly()

```python
@classmethod
def monthly() -> TriggerSchedule
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L97-L100)

Build a schedule for the first day of every month, at midnight UTC.

**Returns**

- `TriggerSchedule`

#### TriggerSchedule.weekly()

```python
@classmethod
def weekly() -> TriggerSchedule
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/scheduled_trigger.py#L91-L94)

Build a schedule for every Sunday at midnight UTC.

**Returns**

- `TriggerSchedule`
