---
sidebar:
  hidden: true
title: roboto.domain.triggers.record
---
## Module Contents

### ManagedBy

```python
class roboto.domain.triggers.record.ManagedBy(/, **data: Any)
```

`from roboto.domain.triggers import ManagedBy`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/record.py#L31-L52)

Bases: `pydantic.BaseModel`

Owner that manages a trigger's definition in place of the organization's members.

A managed trigger cannot be deleted, or have its definition changed, through [`Trigger`](/docs/reference/python-sdk/roboto/domain/triggers/trigger#roboto.domain.triggers.trigger.Trigger). Members of the organization can still enable or disable a trigger Roboto manages. A trigger an ingestion rule owns cannot be enabled, disabled, edited or deleted directly; change the rule instead, such as by turning its auto-ingest off. An organization has at most one trigger per owner.

Carried in `TriggerRecord.managed_by`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **ManagedBy.id** (`str`): ID of the owner, whose meaning depends on the owner's kind.

  For `ManagedByKind.System`, it is the key of the Roboto feature, such as `"session_metrics"`; for `ManagedByKind.IngestionRule`, it is the rule's ID.

- **ManagedBy.kind** (`ManagedByKind`): Kind of owner that manages the trigger.

- **ManagedBy.model_config**: Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

### ManagedByKind

```python
class roboto.domain.triggers.record.ManagedByKind
```

`from roboto.domain.triggers import ManagedByKind`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/record.py#L18-L28)

Bases: `roboto.compat.StrEnum`

Kind of owner that manages a trigger in place of the organization's members.

**Attributes**

- **ManagedByKind.IngestionRule** = `'ingestion_rule'`: Ingestion rules (`roboto.experimental.ingestion_rules.IngestionRuleRecord`).

  Each rule owns the trigger that ingests the files the rule matches.

- **ManagedByKind.System** = `'system'`: Roboto, which installed the trigger to run one of its own features, such as computing session metrics.

### TriggerRecord

```python
class roboto.domain.triggers.record.TriggerRecord(/, **data: Any)
```

`from roboto.domain.triggers import TriggerRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/record.py#L55-L136)

Bases: `pydantic.BaseModel`

Data record of a trigger, as the Roboto API returns it.

A trigger is a rule that responds to activity in an organization. It has a firing source (a subscription to platform events, or a schedule), an optional condition over the variables a firing exposes, and the targets to run when the condition holds. [`Trigger`](/docs/reference/python-sdk/roboto/domain/triggers/trigger#roboto.domain.triggers.trigger.Trigger) wraps this record with methods that act on the trigger, and exposes it as [`record`](/docs/reference/python-sdk/roboto/domain/triggers/trigger#roboto.domain.triggers.trigger.Trigger.record).

When a trigger is saved, Roboto checks the rules that span its fields with [`TriggerValidator`](/docs/reference/python-sdk/roboto/domain/triggers/validation#roboto.domain.triggers.validation.TriggerValidator): the condition references only variables every subscribed platform event exposes, [`once_per`](/docs/reference/python-sdk/roboto/domain/triggers/sources#roboto.domain.triggers.sources.EventSubscription.once_per) is legal for every subscribed event, and every target template placeholder resolves. A trigger's targets run as its organization's service user, never as the user who created the trigger.

**Parameters**

- **data** (`Any`)

**Attributes**

- **TriggerRecord.condition** (`roboto.query.ConditionType | None`) = `None`: Condition over the variables a firing exposes, which must hold for the trigger to run its targets.

  It takes the [`Condition`](/docs/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Condition) format Roboto's queries use. `None` runs the targets on every firing.

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

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

  Roboto's own system user when Roboto made the change.

- **TriggerRecord.enabled** (`bool`) = `True`: Whether the trigger is enabled. A disabled trigger does not fire.

- **TriggerRecord.engine** (`str`) = `'v1'`: Trigger model Roboto evaluates the trigger with, `"v2"` or `"v1"`.

  `"v2"` is the model of this package; `"v1"` is the deprecated `causes`/`for_each` model of [`Trigger`](/docs/reference/python-sdk/roboto/domain/actions/trigger#roboto.domain.actions.trigger.Trigger).

  Roboto sets it; no request does. It defaults to `"v1"` when a response omits it, as a response from a Roboto deployment that predates the field does.

- **TriggerRecord.fires_on** (`roboto.domain.triggers.sources.TriggerSource`): What makes the trigger fire: a subscription to platform events, or a schedule.

  The value is an [`EventSubscription`](/docs/reference/python-sdk/roboto/domain/triggers/sources#roboto.domain.triggers.sources.EventSubscription), which also carries [`once_per`](/docs/reference/python-sdk/roboto/domain/triggers/sources#roboto.domain.triggers.sources.EventSubscription.once_per), or a [`Schedule`](/docs/reference/python-sdk/roboto/domain/triggers/sources#roboto.domain.triggers.sources.Schedule).

- **TriggerRecord.managed_by** (`ManagedBy | None`) = `None`: Owner that manages the trigger's definition, or `None` if the organization's members manage it.

  One such owner is the ingestion rule the trigger ingests files for. Roboto sets it; no request does.

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

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

  Roboto's own system user when Roboto made the change. Roboto modifies a trigger when it disables the trigger, such as after one of its targets' actions was deleted.

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

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

  An event-fired trigger fires only on that organization's platform events.

- **TriggerRecord.targets** (`list[roboto.domain.triggers.targets.TriggerTargetSpec]`): Targets the trigger runs when it fires. At least one; each `target_id` is unique within the trigger.

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