Represents a trigger in the Flyte platform.
Attributes
| Attribute | Type | Description |
|---|
| pb2 | trigger_definition_pb2.Trigger | The underlying Protobuf message containing the canonical definition and state of the trigger. |
| details | `TriggerDetails | None` = None |
Methods
create()
@classmethod
def create(
trigger: flyte.Trigger,
task_name: str,
task_version: str | None = None
) - > [Trigger](trigger.md?sid=flyte_remote__trigger_trigger)
Create a new trigger in the Flyte platform.
Parameters
| Name | Type | Description |
|---|
| trigger | flyte.Trigger | The flyte.Trigger object containing the trigger definition. |
| task_name | str | Optional name of the task to associate with the trigger. |
| task_version | `str | None` = None |
Returns
| Type | Description |
|---|
[Trigger](trigger.md?sid=flyte_remote__trigger_trigger) | The newly created Trigger instance containing the deployment details. |
get()
@classmethod
def get(
name: str,
task_name: str
) - > TriggerDetails
Retrieve a trigger by its name and associated task name.
Parameters
| Name | Type | Description |
|---|
| name | str | The unique name of the trigger to retrieve. |
| task_name | str | The name of the task associated with the trigger. |
Returns
| Type | Description |
|---|
TriggerDetails | The detailed information and metadata for the specified trigger. |
listall()
@classmethod
def listall(
task_name: str | None = None,
task_version: str | None = None,
limit: int = 100
) - > AsyncIterator[[Trigger](trigger.md?sid=flyte_remote__trigger_trigger)]
List all triggers associated with a specific task or all tasks if no task name is provided.
Parameters
| Name | Type | Description |
|---|
| task_name | `str | None` = None |
| task_version | `str | None` = None |
| limit | int = 100 | The maximum number of triggers to return in a single batch. |
Returns
| Type | Description |
|---|
AsyncIterator[[Trigger](trigger.md?sid=flyte_remote__trigger_trigger)] | An asynchronous iterator yielding Trigger instances matching the filter criteria. |
update()
@classmethod
def update(
name: str,
task_name: str,
active: bool
)
Pause a trigger by its name and associated task name.
Parameters
| Name | Type | Description |
|---|
| name | str | The name of the trigger to update. |
| task_name | str | The name of the task associated with the trigger. |
| active | bool | The desired state of the trigger; set to True to enable or False to pause. |
delete()
@classmethod
def delete(
name: str,
task_name: str,
project: str | None = None,
domain: str | None = None
)
Delete a trigger by its name.
Parameters
| Name | Type | Description |
|---|
| name | str | The name of the trigger to be removed. |
| task_name | str | The name of the task associated with the trigger. |
| project | `str | None` = None |
| domain | `str | None` = None |
id()
@classmethod
def id() - > identifier_pb2.TriggerIdentifier
Get the unique identifier for the trigger.
Returns
| Type | Description |
|---|
identifier_pb2.TriggerIdentifier | The protobuf identifier containing the trigger's name, project, and domain. |
name()
@classmethod
def name() - > str
Get the name of the trigger.
Returns
| Type | Description |
|---|
str | The string name of the trigger. |
task_name()
@classmethod
def task_name() - > str
Get the name of the task associated with this trigger.
Returns
| Type | Description |
|---|
str | The name of the task that this trigger executes. |
automation_spec()
@classmethod
def automation_spec() - > common_pb2.TriggerAutomationSpec
Get the automation specification for the trigger.
Returns
| Type | Description |
|---|
common_pb2.TriggerAutomationSpec | The protobuf specification defining the automation logic (e.g., schedule). |
url()
@classmethod
def url() - > str
Get the console URL for viewing the trigger.
Returns
| Type | Description |
|---|
str | A fully qualified URL to view the trigger in the Flyte Console. |
get_details()
@classmethod
def get_details() - > TriggerDetails
Get detailed information about this trigger.
Returns
| Type | Description |
|---|
TriggerDetails | The full details of the trigger, fetched from the platform if not already cached. |
is_active()
@classmethod
def is_active() - > bool
Check if the trigger is currently active.
Returns
| Type | Description |
|---|
bool | True if the trigger is enabled and running, False otherwise. |