Skip to main content

Trigger

Specification for a scheduled trigger that can be associated with any Flyte task.

Attributes

AttributeTypeDescription
namestrUnique name for the trigger (required).
automationUnion[[Cron](cron.md?sid=flyte__trigger_cron), [FixedRate](fixedrate.md?sid=flyte__trigger_fixedrate)]Schedule type — Cron(...) or FixedRate(...) (required).
descriptionstr = ""Human-readable description (max 255 characters).
auto_activatebool = TrueWhether to activate the trigger automatically on deployment.
inputs`Dict[str, Any]None` = null
env_vars`Dict[str, str]None` = null
interruptible`boolNone` = null
overwrite_cachebool = FalseForce cache refresh on triggered runs.
queue`strNone` = null
labels`Mapping[str, str]None` = null
annotations`Mapping[str, str]None` = null
notifications`NamedRuleNotification
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

NameTypeDescription
namestrUnique name for the trigger.
automationUnion[[Cron](cron.md?sid=flyte__trigger_cron), [FixedRate](fixedrate.md?sid=flyte__trigger_fixedrate)]The schedule type, either a Cron or FixedRate object.
descriptionstr = ""Human-readable description (max 255 characters).
auto_activatebool = TrueWhether to activate the trigger automatically on deployment.
inputs`Dict[str, Any]None` = None
env_vars`Dict[str, str]None` = None
interruptible`boolNone` = None
overwrite_cachebool = FalseForce cache refresh on triggered runs.
queue`strNone` = None
labels`Mapping[str, str]None` = None
annotations`Mapping[str, str]None` = None
notifications`NamedRuleNotification
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

NameTypeDescription
trigger_time_input_key`strNone` = None
namestr = dailyThe name of the trigger, default is "daily".
descriptionstr = A trigger that runs daily at midnightA description of the trigger.
auto_activatebool = TrueWhether the trigger should be automatically activated.
inputs`Dict[str, Any]None` = None
env_vars`Dict[str, str]None` = None
interruptible`boolNone` = None
overwrite_cachebool = FalseWhether to overwrite the cache.
queue`strNone` = None
labels`Mapping[str, str]None` = None
annotations`Mapping[str, str]None` = None
custom_context`Mapping[str, str]None` = None

Returns

TypeDescription
[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

NameTypeDescription
trigger_time_input_key`strNone` = None
namestr = hourlyThe name of the trigger, default is "hourly".
descriptionstr = A trigger that runs every hourA description of the trigger.
auto_activatebool = TrueWhether the trigger should be automatically activated.
inputs`Dict[str, Any]None` = None
env_vars`Dict[str, str]None` = None
interruptible`boolNone` = None
overwrite_cachebool = FalseWhether to overwrite the cache.
queue`strNone` = None
labels`Mapping[str, str]None` = None
annotations`Mapping[str, str]None` = None
custom_context`Mapping[str, str]None` = None

Returns

TypeDescription
[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

NameTypeDescription
trigger_time_input_key`strNone` = None
namestr = minutelyThe name of the trigger, default is "every_minute".
descriptionstr = A trigger that runs every minuteA description of the trigger.
auto_activatebool = TrueWhether the trigger should be automatically activated.
inputs`Dict[str, Any]None` = None
env_vars`Dict[str, str]None` = None
interruptible`boolNone` = None
overwrite_cachebool = FalseWhether to overwrite the cache.
queue`strNone` = None
labels`Mapping[str, str]None` = None
annotations`Mapping[str, str]None` = None
custom_context`Mapping[str, str]None` = None

Returns

TypeDescription
[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

NameTypeDescription
trigger_time_input_key`strNone` = None
namestr = weeklyThe name of the trigger, default is "weekly".
descriptionstr = A trigger that runs weekly on Sundays at midnightA description of the trigger.
auto_activatebool = TrueWhether the trigger should be automatically activated.
inputs`Dict[str, Any]None` = None
env_vars`Dict[str, str]None` = None
interruptible`boolNone` = None
overwrite_cachebool = FalseWhether to overwrite the cache.
queue`strNone` = None
labels`Mapping[str, str]None` = None
annotations`Mapping[str, str]None` = None
custom_context`Mapping[str, str]None` = None

Returns

TypeDescription
[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

NameTypeDescription
trigger_time_input_key`strNone` = None
namestr = monthlyThe name of the trigger, default is "monthly".
descriptionstr = A trigger that runs monthly on the 1st at midnightA description of the trigger.
auto_activatebool = TrueWhether the trigger should be automatically activated.
inputs`Dict[str, Any]None` = None
env_vars`Dict[str, str]None` = None
interruptible`boolNone` = None
overwrite_cachebool = FalseWhether to overwrite the cache.
queue`strNone` = None
labels`Mapping[str, str]None` = None
annotations`Mapping[str, str]None` = None
custom_context`Mapping[str, str]None` = None

Returns

TypeDescription
[Trigger](../remote/trigger/trigger.md?sid=flyte_remote__trigger_trigger)A trigger that runs monthly on the 1st at midnight.