Trigger
Trigger is the mutable latest-state row for a trigger. One row per (project, domain, task_name, name); updated in-place on each deploy/activate/delete. Mirrors the pattern used by Action (latest state) + ActionEvent (history).
Attributes
| Attribute | Type | Description |
|---|---|---|
| ID | uint | This attribute stores the unique identifier for the trigger. |
| Project | string | This attribute stores the project name associated with the trigger, forming part of its unique identity. |
| Domain | string | This attribute stores the domain name associated with the trigger, forming part of its unique identity. |
| TaskName | string | This attribute stores the name of the task associated with the trigger, forming part of its unique identity. |
| Name | string | This attribute stores the name of the trigger, forming part of its unique identity. |
| LatestRevision | uint64 | This attribute stores a monotonically increasing counter that is incremented on every write to the trigger. |
| Spec | []byte | This attribute stores the serialized protobuf specification of the trigger. |
| AutomationSpec | []byte | This attribute stores the serialized protobuf specification for the automation associated with the trigger. |
| TaskVersion | string | This attribute stores the denormalized task version for cheap queries without deserializing protos. |
| Active | bool | This attribute indicates whether the trigger is active, allowing for cheap queries without deserializing protos. |
| AutomationType | string | This attribute stores the type of automation associated with the trigger, allowing for cheap queries without deserializing protos. |
| DeployedBy | sql.NullString | This attribute stores the identity of the user who deployed the trigger. |
| UpdatedBy | sql.NullString | This attribute stores the identity of the user who last updated the trigger. |
| DeployedAt | time.Time | This attribute stores the timestamp when the trigger was deployed. |
| UpdatedAt | time.Time | This attribute stores the timestamp when the trigger was last updated. |
| TriggeredAt | sql.NullTime | This attribute stores the timestamp when the trigger was last activated. |
| DeletedAt | sql.NullTime | This attribute stores the timestamp when the trigger was deleted. |
| Description | sql.NullString | This attribute stores an optional description for the trigger. |
Methods
ToTaskKey()
@classmethod
def ToTaskKey() - > [TaskKey](taskkey.md?sid=runs_repository_models_taskkey)
Converts the Trigger object's identity fields into a TaskKey, which uniquely identifies the associated task.
Returns
| Type | Description |
|---|---|
[TaskKey](taskkey.md?sid=runs_repository_models_taskkey) | A TaskKey object representing the unique identifier for the task associated with this trigger. |