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

roboto.domain.actions.trigger_record

Module Contents

TriggerEvaluationCause

class roboto.domain.actions.trigger_record.TriggerEvaluationCause(*args, **kwds)#View Source

Bases: enum.Enum

The cause of a TriggerEvaluationRecord is the reason why the trigger was selected for evaluation.

Represents the specific event that caused a trigger to be evaluated for potential execution. Different causes may result in different trigger behavior or input data selection.

Attributes

TriggerEvaluationCause.DatasetMetadataUpdate

DatasetMetadataUpdate = 'dataset_metadata_update' #

Trigger evaluation caused by changes to dataset metadata.

TriggerEvaluationCause.FileIngest

FileIngest = 'file_ingest' #

Trigger evaluation caused by files being ingested into a dataset.

TriggerEvaluationCause.FileMetadataUpdate

FileMetadataUpdate = 'file_metadata_update' #

Trigger evaluation caused by file metadata or tag updates.

TriggerEvaluationCause.FileUpload

FileUpload = 'file_upload' #

Trigger evaluation caused by new files being uploaded to a dataset.

TriggerEvaluationCause.RecurringSchedule

RecurringSchedule = 'recurring_schedule' #

Trigger evaluation caused by a recurring schedule.

This cause is used internally by the Roboto system, to track the evaluation history of scheduled triggers. It should not be used when creating or updating triggers, and doing so will result in an error.

To create a trigger that invokes an action on a recurring schedule, use ScheduledTrigger.

TriggerEvaluationDataConstraint

class roboto.domain.actions.trigger_record.TriggerEvaluationDataConstraint(/, **data)#View Source

Bases: pydantic.BaseModel

An optional filtering constraint applied to the data considered by a trigger evaluation.

Each trigger evaluation considers data of a particular data source ID and data source type. Typically (and to start, exclusively), this is a dataset ID (and type Dataset).

In the naive case before the introduction of this class, trigger evaluation for a dataset with 20k files would have to scan each file. This constraint allows us to filter the data to a subset during evaluation, e.g. only evaluate files from dataset ds_12345 with upload ID tx_123abc

Parameters

data Any

Attributes

TriggerEvaluationDataConstraint.file_id

file_id str | None = None #

If set, only consider this file as part of trigger evaluation.

TriggerEvaluationDataConstraint.transaction_id

transaction_id str | None = None #

If set, only consider files from this upload.

TriggerEvaluationOutcome

class roboto.domain.actions.trigger_record.TriggerEvaluationOutcome(*args, **kwds)#View Source

Bases: enum.Enum

The outcome of a TriggerEvaluationRecord is the result of the evaluation. A trigger can either invoke its associated action (one or many times) or be skipped. If skipped, a skip reason is provided.

Attributes

TriggerEvaluationOutcome.InvokedAction

InvokedAction = 'invoked_action' #

TriggerEvaluationOutcome.Skipped

Skipped = 'skipped' #

TriggerEvaluationOutcomeReason

class roboto.domain.actions.trigger_record.TriggerEvaluationOutcomeReason(*args, **kwds)#View Source

Bases: enum.Enum

Context for why a trigger evaluation has its TriggerEvaluationOutcome

Attributes

TriggerEvaluationOutcomeReason.AlreadyRun

AlreadyRun = 'already_run' #

This trigger has already run its associated action for this dataset and/or file.

TriggerEvaluationOutcomeReason.ConditionNotMet

ConditionNotMet = 'condition_not_met' #

The trigger’s condition is not met.

TriggerEvaluationOutcomeReason.NoMatchingFiles

NoMatchingFiles = 'no_matching_files' #

In the case of a dataset trigger, there is no subset of files that, combined, match ALL of the trigger’s required inputs.

In the case of a file trigger, there are no files that match ANY of the trigger’s required inputs.

TriggerEvaluationOutcomeReason.TriggerDisabled

TriggerDisabled = 'trigger_disabled' #

The trigger is disabled.

TriggerEvaluationRecord

class roboto.domain.actions.trigger_record.TriggerEvaluationRecord(/, **data)#View Source

Bases: pydantic.BaseModel

Record of a point-in-time evaluation of whether to invoke an action associated with a trigger for a data source.

Parameters

data Any

Attributes

TriggerEvaluationRecord.cause

cause TriggerEvaluationCause | None = None #

TriggerEvaluationRecord.data_constraint

data_constraint TriggerEvaluationDataConstraint | None = None #

TriggerEvaluationRecord.data_source

TriggerEvaluationRecord.evaluation_end

evaluation_end datetime.datetime | None = None #

TriggerEvaluationRecord.evaluation_start

evaluation_start datetime.datetime #

TriggerEvaluationRecord.outcome

outcome TriggerEvaluationOutcome | None = None #

TriggerEvaluationRecord.outcome_reason

outcome_reason TriggerEvaluationOutcomeReason | None = None #

TriggerEvaluationRecord.status

TriggerEvaluationRecord.status_detail

status_detail str | None = None #

TriggerEvaluationRecord.trigger_evaluation_id

trigger_evaluation_id int #

TriggerEvaluationRecord.trigger_id

trigger_id str #

TriggerEvaluationStatus

class roboto.domain.actions.trigger_record.TriggerEvaluationStatus(*args, **kwds)#View Source

Bases: enum.Enum

When a trigger is selected for evaluation, a trigger evaluation record is created with a status of Pending. The evaluation can either run to completion (regardless of its outcome), in which case the status is Evaluated, or hit an unexpected exception, in which case the status is Failed.

Attributes

TriggerEvaluationStatus.Evaluated

Evaluated = 'evaluated' #

TriggerEvaluationStatus.Failed

Failed = 'failed' #

TriggerEvaluationStatus.Pending

Pending = 'pending' #

TriggerForEachPrimitive

class roboto.domain.actions.trigger_record.TriggerForEachPrimitive#View Source

Bases: roboto.compat.StrEnum

Defines the granularity at which a trigger executes.

Determines whether the trigger creates one invocation per dataset or one invocation per file within datasets that match the trigger conditions.

Attributes

TriggerForEachPrimitive.Dataset

Dataset = 'dataset' #

Execute one action invocation per dataset that matches the trigger conditions.

TriggerForEachPrimitive.DatasetFile

DatasetFile = 'dataset_file' #

Execute one action invocation per file in datasets that match the trigger conditions.

TriggerRecord

class roboto.domain.actions.trigger_record.TriggerRecord(/, **data)#View Source

Bases: pydantic.BaseModel

A wire-transmissible representation of a trigger.

Contains all the configuration and metadata for a trigger, including the target action, input requirements, conditions, and execution settings.

This is the underlying data structure used by the Trigger domain class to store and transmit trigger information.

Parameters

data Any

Attributes

TriggerRecord.action

Reference to the action that should be invoked.

TriggerRecord.additional_inputs

additional_inputs list[str] | None = None #

Optional additional file patterns to include.

TriggerRecord.causes

causes list[TriggerEvaluationCause] | None = None #

List of events that can cause this trigger to be evaluated.

TriggerRecord.compute_requirement_overrides

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

Optional compute requirement overrides.

TriggerRecord.condition

condition roboto.query.ConditionType | None = None #

Optional condition that must be met for trigger to fire.

TriggerRecord.container_parameter_overrides

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

Optional container parameter overrides.

TriggerRecord.created

created datetime.datetime #

Timestamp when the trigger was created.

TriggerRecord.created_by

created_by str #

User ID who created the trigger.

TriggerRecord.enabled

enabled bool = True #

Whether the trigger is currently active.

TriggerRecord.for_each

Granularity of trigger execution (Dataset or DatasetFile).

TriggerRecord.modified

modified datetime.datetime #

Timestamp when the trigger was last modified.

TriggerRecord.modified_by

modified_by str #

User ID who last modified the trigger.

TriggerRecord.name

name str #

Human-readable name for the trigger.

TriggerRecord.org_id

org_id str #

Organization ID that owns the trigger.

TriggerRecord.parameter_values

parameter_values dict[str, Any] = None #

Parameter values to pass to the action.

TriggerRecord.required_inputs

required_inputs list[str] #

File patterns that must be present for trigger to fire.

TriggerRecord.service_user_id

service_user_id str #

Service user ID for authentication.

TriggerRecord.timeout

timeout int | None = None #

Optional timeout override for action execution.

TriggerRecord.trigger_id

trigger_id str #

Unique identifier for the trigger.

TriggerRecord.validate_additional_inputs()

validate_additional_inputs(value)#View Source

Parameters

value Optional[list[str]]

Return type

Optional[list[str]]

TriggerRecord.validate_required_inputs()

validate_required_inputs(value)#View Source

Parameters

value list[str]

Return type

list[str]

Was this page helpful?