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

### TriggerEvaluationCause

```python
class roboto.domain.actions.trigger_record.TriggerEvaluationCause(*args, **kwds)
```

`from roboto import TriggerEvaluationCause`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/trigger_record.py#L38-L58)

Bases: `enum.Enum`

Platform event that causes Roboto to evaluate a trigger, deciding whether to invoke its action.

**Attributes**

- **TriggerEvaluationCause.DatasetMetadataUpdate** = `'dataset_metadata_update'`: Change to a dataset's metadata.

- **TriggerEvaluationCause.FileIngest** = `'file_ingest'`: Ingestion of a file in a dataset.

- **TriggerEvaluationCause.FileMetadataUpdate** = `'file_metadata_update'`: Change to a file's metadata or tags.

- **TriggerEvaluationCause.FileUpload** = `'file_upload'`: Upload of files to a dataset.

- **TriggerEvaluationCause.RecurringSchedule** = `'recurring_schedule'`: Due time on a scheduled trigger's schedule.

  Roboto sets this cause on the evaluations of scheduled triggers, and rejects a trigger created or updated with it. To invoke an action on a recurring schedule, use [`ScheduledTrigger`](/docs/reference/python-sdk/roboto/domain/actions/scheduled_trigger#roboto.domain.actions.scheduled_trigger.ScheduledTrigger).

### TriggerEvaluationDataConstraint

```python
class roboto.domain.actions.trigger_record.TriggerEvaluationDataConstraint(
    /,
    **data: Any,
)
```

`from roboto.domain.actions import TriggerEvaluationDataConstraint`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/trigger_record.py#L210-L220)

Bases: `pydantic.BaseModel`

Limit on which of a data source's files a trigger evaluation considers.

Carried in `TriggerEvaluationRecord.data_constraint`.

**Parameters**

- **data** (`Any`)

**Attributes**

- **TriggerEvaluationDataConstraint.file_id** (`str | None`) = `None`: ID of the one file the evaluation considers, or `None` to consider every file.
- **TriggerEvaluationDataConstraint.transaction_id** (`str | None`) = `None`: ID of the upload whose files the evaluation considers, or `None` to consider files from any upload.

### TriggerEvaluationOutcome

```python
class roboto.domain.actions.trigger_record.TriggerEvaluationOutcome(*args, **kwds)
```

`from roboto import TriggerEvaluationOutcome`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/trigger_record.py#L177-L184)

Bases: `enum.Enum`

Result of a trigger evaluation: the trigger invoked its action, once or more, or skipped it.

New evaluations are only ever `InvokedAction`; `Skipped` appears only on older evaluations.

**Attributes**

- **TriggerEvaluationOutcome.InvokedAction** = `'invoked_action'`
- **TriggerEvaluationOutcome.Skipped** = `'skipped'`

### TriggerEvaluationOutcomeReason

```python
class roboto.domain.actions.trigger_record.TriggerEvaluationOutcomeReason(*args, **kwds)
```

`from roboto import TriggerEvaluationOutcomeReason`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/trigger_record.py#L187-L207)

Bases: `enum.Enum`

Reason a trigger evaluation was skipped.

Only older evaluations carry one, because new evaluations are never `TriggerEvaluationOutcome.Skipped`.

**Attributes**

- **TriggerEvaluationOutcomeReason.AlreadyRun** = `'already_run'`: The trigger already invoked its action for this dataset or file.

- **TriggerEvaluationOutcomeReason.ConditionNotMet** = `'condition_not_met'`: The data does not meet the trigger's condition.

- **TriggerEvaluationOutcomeReason.NoMatchingFiles** = `'no_matching_files'`: No files match the trigger's required inputs.

  For a trigger that runs once per dataset, no set of the dataset's files matches every required input. For a trigger that runs once per file, no file matches any required input.

- **TriggerEvaluationOutcomeReason.TriggerDisabled** = `'trigger_disabled'`: The trigger is disabled.

### TriggerEvaluationRecord

```python
class roboto.domain.actions.trigger_record.TriggerEvaluationRecord(/, **data: Any)
```

`from roboto import TriggerEvaluationRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/trigger_record.py#L223-L267)

Bases: `pydantic.BaseModel`

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

The record belongs to the legacy trigger model; [`Trigger`](/docs/reference/python-sdk/roboto/domain/triggers/trigger#roboto.domain.triggers.trigger.Trigger) reads and edits every trigger. An evaluation decides, at one point in time, whether a trigger invokes its action for a data source. Returned by [`get_evaluations()`](/docs/reference/python-sdk/roboto/domain/actions/trigger#roboto.domain.actions.trigger.Trigger.get_evaluations), and also by [`latest_evaluation()`](/docs/reference/python-sdk/roboto/domain/actions/trigger#roboto.domain.actions.trigger.Trigger.latest_evaluation) and [`get_evaluations_for_dataset()`](/docs/reference/python-sdk/roboto/domain/actions/trigger#roboto.domain.actions.trigger.Trigger.get_evaluations_for_dataset).

**Parameters**

- **data** (`Any`)

**Attributes**

- **TriggerEvaluationRecord.cause** (`TriggerEvaluationCause | None`) = `None`: Platform event that caused the evaluation, or `None` when that platform event has no matching cause.

- **TriggerEvaluationRecord.data_constraint** (`TriggerEvaluationDataConstraint | None`) = `None`: Limit on which of the data source's files the evaluation considered, or `None` if it considered them all.

- **TriggerEvaluationRecord.data_source** (`roboto.domain.actions.invocation_record.InvocationDataSource`): Data source the evaluation considered, usually a dataset.

- **TriggerEvaluationRecord.evaluation_end** (`datetime.datetime | None`) = `None`: Time the evaluation finished, or `None` if it has not.

- **TriggerEvaluationRecord.evaluation_start** (`datetime.datetime`): Time the evaluation started.

- **TriggerEvaluationRecord.outcome** (`TriggerEvaluationOutcome | None`) = `None`: Result of the evaluation, or `None` while it is pending or when it failed.

- **TriggerEvaluationRecord.outcome_reason** (`TriggerEvaluationOutcomeReason | None`) = `None`: Reason the evaluation was skipped, or `None` if it was not.

  New evaluations are never skipped, so only older evaluations have one.

- **TriggerEvaluationRecord.status** (`TriggerEvaluationStatus`): Progress of the evaluation.

- **TriggerEvaluationRecord.status_detail** (`str | None`) = `None`: Detail on the status, such as the error that made the evaluation fail, or `None` if there is none.

- **TriggerEvaluationRecord.trigger_evaluation_id** (`int`): Unique ID of the evaluation.

- **TriggerEvaluationRecord.trigger_id** (`str`): ID of the trigger evaluated.

### TriggerEvaluationStatus

```python
class roboto.domain.actions.trigger_record.TriggerEvaluationStatus(*args, **kwds)
```

`from roboto import TriggerEvaluationStatus`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/trigger_record.py#L163-L174)

Bases: `enum.Enum`

Progress of a trigger evaluation.

An evaluation starts as `Pending`. It becomes `Evaluated` when the trigger invokes its action, and `Failed` when an error stops it. Roboto records an evaluation only when a trigger goes to invoke its action, so new evaluations are never `Evaluated` without invoking it. Older evaluations can also be `Evaluated` with the outcome `TriggerEvaluationOutcome.Skipped`.

**Attributes**

- **TriggerEvaluationStatus.Evaluated** = `'evaluated'`
- **TriggerEvaluationStatus.Failed** = `'failed'`
- **TriggerEvaluationStatus.Pending** = `'pending'`

### TriggerForEachPrimitive

```python
class roboto.domain.actions.trigger_record.TriggerForEachPrimitive
```

`from roboto import TriggerForEachPrimitive`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/trigger_record.py#L28-L35)

Bases: `roboto.compat.StrEnum`

How often a trigger invokes its action: once per dataset, or once per file.

**Attributes**

- **TriggerForEachPrimitive.Dataset** = `'dataset'`: One invocation of the action for each dataset whose files match every one of the trigger's required inputs.
- **TriggerForEachPrimitive.DatasetFile** = `'dataset_file'`: One invocation of the action for each file that matches any of the trigger's required inputs.

### TriggerRecord

```python
class roboto.domain.actions.trigger_record.TriggerRecord(/, **data: Any)
```

`from roboto import TriggerRecord`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/trigger_record.py#L61-L160)

Bases: `pydantic.BaseModel`

Deprecated. Data record of a trigger in the legacy trigger model, as the Roboto API returns it.

[`Trigger`](/docs/reference/python-sdk/roboto/domain/triggers/trigger#roboto.domain.triggers.trigger.Trigger) replaces this model, and reads and edits every trigger, including those this model cannot express. A trigger is a rule that invokes an action when files are uploaded or ingested, or when file or dataset metadata changes, and the data meets the trigger's condition. [`Trigger`](/docs/reference/python-sdk/roboto/domain/actions/trigger#roboto.domain.actions.trigger.Trigger), also deprecated, wraps this record with methods that act on the trigger.

Building one raises `pydantic.ValidationError` unless at least one `required_inputs` pattern is neither empty nor only whitespace, and when `additional_inputs` is a non-empty list whose every pattern is empty or only whitespace.

**Parameters**

- **data** (`Any`)

**Attributes**

- **TriggerRecord.action** (`roboto.domain.actions.action_record.ActionReference`): Action the trigger invokes. A reference without a digest invokes the action's latest version.

- **TriggerRecord.additional_inputs** (`list[str] | None`) = `None`: Gitignore-style patterns for more files to pass to the action as input data.

  Unlike `required_inputs`, no file has to match them for the trigger to invoke its action. `None` or an empty list adds no files.

- **TriggerRecord.causes** (`list[TriggerEvaluationCause] | None`) = `None`: Platform events that cause Roboto to evaluate the trigger.

  A trigger created without any is evaluated on file uploads.

- **TriggerRecord.compute_requirement_overrides** (`roboto.domain.actions.action_record.ComputeRequirements | None`) = `None`: Compute requirements that replace the action's own in each invocation, or `None` to use the action's.

- **TriggerRecord.condition** (`roboto.query.ConditionType | None`) = `None`: Condition the data must meet for the trigger to invoke its action, or `None` if the trigger has none.

- **TriggerRecord.container_parameter_overrides** (`roboto.domain.actions.action_record.ContainerParameters | None`) = `None`: Container parameters that replace the action's own in each invocation, or `None` to use the action's.

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

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

- **TriggerRecord.enabled** (`bool`) = `True`: Whether the trigger is enabled. A disabled trigger never invokes its action.

- **TriggerRecord.for_each** (`TriggerForEachPrimitive`): Whether the trigger invokes its action once per dataset or once per file.

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

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

- **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.

- **TriggerRecord.parameter_values** (`dict[str, Any]`) = `None`: Values for the action's parameters, keyed by parameter name, that each invocation receives.

- **TriggerRecord.required_inputs** (`list[str]`): Gitignore-style patterns for the files the trigger requires, and passes to the action as its input data.

  With `for_each` set to `TriggerForEachPrimitive.Dataset`, the trigger invokes its action when each pattern matches at least one file in the dataset. With `TriggerForEachPrimitive.DatasetFile`, it invokes the action once for each file that matches any pattern. At least one pattern must be neither empty nor only whitespace.

- **TriggerRecord.service_user_id** (`str`): ID of the service user the trigger invokes its action as.

- **TriggerRecord.timeout** (`int | None`) = `None`: Maximum run time of each invocation, in minutes, or `None` to use the action's timeout.

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

#### TriggerRecord.validate_additional_inputs()

```python
def validate_additional_inputs(value: Optional[list[str]]) -> Optional[list[str]]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/trigger_record.py#L152-L160)

Replace `None` with an empty list, and reject a list whose every pattern is empty or only whitespace.

Pydantic calls this while it builds the record.

**Parameters**

- **value** (`Optional[list[str]]`)

**Returns**

- `Optional[list[str]]`

#### TriggerRecord.validate_required_inputs()

```python
def validate_required_inputs(value: list[str]) -> list[str]
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/actions/trigger_record.py#L144-L149)

Reject `required_inputs` unless at least one pattern is neither empty nor only whitespace.

Pydantic calls this while it builds the record.

**Parameters**

- **value** (`list[str]`)

**Returns**

- `list[str]`
