Trigger
Specification for a scheduled trigger that can be associated with any Flyte task.
Attributes
| Attribute | Type | Description |
|---|---|---|
| name | str | Unique name for the trigger (required). |
| automation | Union[[Cron](cron.md?sid=flyte__trigger_cron), [FixedRate](fixedrate.md?sid=flyte__trigger_fixedrate)] | Schedule type — Cron(...) or FixedRate(...) (required). |
| description | str = "" | Human-readable description (max 255 characters). |
| auto_activate | bool = True | Whether to activate the trigger automatically on deployment. |
| inputs | `Dict[str, Any] | None` = null |
| env_vars | `Dict[str, str] | None` = null |
| interruptible | `bool | None` = null |
| overwrite_cache | bool = False | Force cache refresh on triggered runs. |
| queue | `str | None` = null |
| labels | `Mapping[str, str] | None` = null |
| annotations | `Mapping[str, str] | None` = null |
| notifications | `NamedRule | Notification |
| custom_context | `Mapping[str, str] | None` = null |
Constructor
Signature
def Trigger(
name: str,
automation: Union[[Cron](cron.md?sid=flyte__trigger_cron), [FixedRate](fixedrate.md?sid=flyte__trigger_fixedrate)],
description: str = "",
auto_activate: bool = True,
inputs: Dict[str, Any]| None = None,
env_vars: Dict[str, str]| None = None,
interruptible: bool | None = None,
overwrite_cache: bool = False,
queue: str | None = None,
labels: Mapping[str, str]| None = None,
annotations: Mapping[str, str]| None = None,
notifications: NamedRule | Notification | Tuple[[Notification](../notify/notifiers/notification.md?sid=flyte_notify__notifiers_notification), ...]| None = None,
custom_context: Mapping[str, str]| None = None
)
Parameters
| Name | Type | Description |
|---|---|---|
| name | str | Unique name for the trigger. |
| automation | Union[[Cron](cron.md?sid=flyte__trigger_cron), [FixedRate](fixedrate.md?sid=flyte__trigger_fixedrate)] | The schedule type, either a Cron or FixedRate object. |
| description | str = "" | Human-readable description (max 255 characters). |
| auto_activate | bool = True | Whether to activate the trigger automatically on deployment. |
| inputs | `Dict[str, Any] | None` = None |
| env_vars | `Dict[str, str] | None` = None |
| interruptible | `bool | None` = None |
| overwrite_cache | bool = False | Force cache refresh on triggered runs. |
| queue | `str | None` = None |
| labels | `Mapping[str, str] | None` = None |
| annotations | `Mapping[str, str] | None` = None |
| notifications | `NamedRule | Notification |
| custom_context | `Mapping[str, str] | None` = None |
Methods
daily()
@classmethod
def daily(
trigger_time_input_key: str | None = None,
name: str = daily,
description: str = A trigger that runs daily at midnight,
auto_activate: bool = True,
inputs: Dict[str, Any]| None = None,
env_vars: Dict[str, str]| None = None,
interruptible: bool | None = None,
overwrite_cache: bool = False,
queue: str | None = None,
labels: Mapping[str, str]| None = None,
annotations: Mapping[str, str]| None = None,
custom_context: Mapping[str, str]| None = None
) - > [Trigger](../remote/trigger/trigger.md?sid=flyte_remote__trigger_trigger)
Creates a Cron trigger that runs daily at midnight.
Parameters
| Name | Type | Description |
|---|---|---|
| trigger_time_input_key | `str | None` = None |
| name | str = daily | The name of the trigger, default is "daily". |
| description | str = A trigger that runs daily at midnight | A description of the trigger. |
| auto_activate | bool = True | Whether the trigger should be automatically activated. |
| inputs | `Dict[str, Any] | None` = None |
| env_vars | `Dict[str, str] | None` = None |
| interruptible | `bool | None` = None |
| overwrite_cache | bool = False | Whether to overwrite the cache. |
| queue | `str | None` = None |
| labels | `Mapping[str, str] | None` = None |
| annotations | `Mapping[str, str] | None` = None |
| custom_context | `Mapping[str, str] | None` = None |
Returns
| Type | Description |
|---|---|
[Trigger](../remote/trigger/trigger.md?sid=flyte_remote__trigger_trigger) | A trigger that runs daily at midnight. |
hourly()
@classmethod
def hourly(
trigger_time_input_key: str | None = None,
name: str = hourly,
description: str = A trigger that runs every hour,
auto_activate: bool = True,
inputs: Dict[str, Any]| None = None,
env_vars: Dict[str, str]| None = None,
interruptible: bool | None = None,
overwrite_cache: bool = False,
queue: str | None = None,
labels: Mapping[str, str]| None = None,
annotations: Mapping[str, str]| None = None,
custom_context: Mapping[str, str]| None = None
) - > [Trigger](../remote/trigger/trigger.md?sid=flyte_remote__trigger_trigger)
Creates a Cron trigger that runs every hour.
Parameters
| Name | Type | Description |
|---|---|---|
| trigger_time_input_key | `str | None` = None |
| name | str = hourly | The name of the trigger, default is "hourly". |
| description | str = A trigger that runs every hour | A description of the trigger. |
| auto_activate | bool = True | Whether the trigger should be automatically activated. |
| inputs | `Dict[str, Any] | None` = None |
| env_vars | `Dict[str, str] | None` = None |
| interruptible | `bool | None` = None |
| overwrite_cache | bool = False | Whether to overwrite the cache. |
| queue | `str | None` = None |
| labels | `Mapping[str, str] | None` = None |
| annotations | `Mapping[str, str] | None` = None |
| custom_context | `Mapping[str, str] | None` = None |
Returns
| Type | Description |
|---|---|
[Trigger](../remote/trigger/trigger.md?sid=flyte_remote__trigger_trigger) | A trigger that runs every hour, on the hour. |
minutely()
@classmethod
def minutely(
trigger_time_input_key: str | None = None,
name: str = minutely,
description: str = A trigger that runs every minute,
auto_activate: bool = True,
inputs: Dict[str, Any]| None = None,
env_vars: Dict[str, str]| None = None,
interruptible: bool | None = None,
overwrite_cache: bool = False,
queue: str | None = None,
labels: Mapping[str, str]| None = None,
annotations: Mapping[str, str]| None = None,
custom_context: Mapping[str, str]| None = None
) - > [Trigger](../remote/trigger/trigger.md?sid=flyte_remote__trigger_trigger)
Creates a Cron trigger that runs every minute.
Parameters
| Name | Type | Description |
|---|---|---|
| trigger_time_input_key | `str | None` = None |
| name | str = minutely | The name of the trigger, default is "every_minute". |
| description | str = A trigger that runs every minute | A description of the trigger. |
| auto_activate | bool = True | Whether the trigger should be automatically activated. |
| inputs | `Dict[str, Any] | None` = None |
| env_vars | `Dict[str, str] | None` = None |
| interruptible | `bool | None` = None |
| overwrite_cache | bool = False | Whether to overwrite the cache. |
| queue | `str | None` = None |
| labels | `Mapping[str, str] | None` = None |
| annotations | `Mapping[str, str] | None` = None |
| custom_context | `Mapping[str, str] | None` = None |
Returns
| Type | Description |
|---|---|
[Trigger](../remote/trigger/trigger.md?sid=flyte_remote__trigger_trigger) | A trigger that runs every minute. |
weekly()
@classmethod
def weekly(
trigger_time_input_key: str | None = None,
name: str = weekly,
description: str = A trigger that runs weekly on Sundays at midnight,
auto_activate: bool = True,
inputs: Dict[str, Any]| None = None,
env_vars: Dict[str, str]| None = None,
interruptible: bool | None = None,
overwrite_cache: bool = False,
queue: str | None = None,
labels: Mapping[str, str]| None = None,
annotations: Mapping[str, str]| None = None,
custom_context: Mapping[str, str]| None = None
) - > [Trigger](../remote/trigger/trigger.md?sid=flyte_remote__trigger_trigger)
Creates a Cron trigger that runs weekly on Sundays at midnight.
Parameters
| Name | Type | Description |
|---|---|---|
| trigger_time_input_key | `str | None` = None |
| name | str = weekly | The name of the trigger, default is "weekly". |
| description | str = A trigger that runs weekly on Sundays at midnight | A description of the trigger. |
| auto_activate | bool = True | Whether the trigger should be automatically activated. |
| inputs | `Dict[str, Any] | None` = None |
| env_vars | `Dict[str, str] | None` = None |
| interruptible | `bool | None` = None |
| overwrite_cache | bool = False | Whether to overwrite the cache. |
| queue | `str | None` = None |
| labels | `Mapping[str, str] | None` = None |
| annotations | `Mapping[str, str] | None` = None |
| custom_context | `Mapping[str, str] | None` = None |
Returns
| Type | Description |
|---|---|
[Trigger](../remote/trigger/trigger.md?sid=flyte_remote__trigger_trigger) | A trigger that runs weekly on Sundays at midnight. |
monthly()
@classmethod
def monthly(
trigger_time_input_key: str | None = None,
name: str = monthly,
description: str = A trigger that runs monthly on the 1st at midnight,
auto_activate: bool = True,
inputs: Dict[str, Any]| None = None,
env_vars: Dict[str, str]| None = None,
interruptible: bool | None = None,
overwrite_cache: bool = False,
queue: str | None = None,
labels: Mapping[str, str]| None = None,
annotations: Mapping[str, str]| None = None,
custom_context: Mapping[str, str]| None = None
) - > [Trigger](../remote/trigger/trigger.md?sid=flyte_remote__trigger_trigger)
Creates a Cron trigger that runs monthly on the 1st at midnight.
Parameters
| Name | Type | Description |
|---|---|---|
| trigger_time_input_key | `str | None` = None |
| name | str = monthly | The name of the trigger, default is "monthly". |
| description | str = A trigger that runs monthly on the 1st at midnight | A description of the trigger. |
| auto_activate | bool = True | Whether the trigger should be automatically activated. |
| inputs | `Dict[str, Any] | None` = None |
| env_vars | `Dict[str, str] | None` = None |
| interruptible | `bool | None` = None |
| overwrite_cache | bool = False | Whether to overwrite the cache. |
| queue | `str | None` = None |
| labels | `Mapping[str, str] | None` = None |
| annotations | `Mapping[str, str] | None` = None |
| custom_context | `Mapping[str, str] | None` = None |
Returns
| Type | Description |
|---|---|
[Trigger](../remote/trigger/trigger.md?sid=flyte_remote__trigger_trigger) | A trigger that runs monthly on the 1st at midnight. |