flytekit.CronSchedule

class flytekit.CronSchedule(cron_expression: Optional[str] = None, schedule: Optional[str] = None, offset: Optional[str] = None, kickoff_time_input_arg: Optional[str] = None)[source]

Use this when you have a launch plan that you want to run on a cron expression. The syntax currently used for this follows the AWS convention

CronSchedule(
    cron_expression="0 10 * * ? *",
)

See cookbook for further examples.

__init__(cron_expression: Optional[str] = None, schedule: Optional[str] = None, offset: Optional[str] = None, kickoff_time_input_arg: Optional[str] = None)[source]
Parameters
  • cron_expression (str) – This should be a cron expression in AWS style.

  • schedule (str) – This takes a cron alias (see _VALID_CRON_ALIASES) or a croniter parseable schedule. Only one of this or cron_expression can be set, not both.

  • offset (str) –

  • kickoff_time_input_arg (str) –

    This is a convenient argument to use when your code needs to know what time a run was kicked off. Supply the name of the input argument of your workflow to this argument here. Note that until Flyte has an atomic clock, there could be a few seconds here and there. That is, if your run is supposed to kick off at 3pm UTC every Weds, it may actually be 15:00:02 or something. Example

    @workflow
    def my_wf(kickoff_time: datetime): ...
    
    schedule = CronSchedule(
        cron_expression="0 10 * * ? *",
        kickoff_time_input_arg="kickoff_time")
    

Methods

__init__(schedule, offset)

param Text schedule

cron expression or aliases

from_flyte_idl(pb2_object)

param flyteidl.admin.schedule_pb2.CronSchedule pb2_object

short_string()

rtype

Text

to_flyte_idl()

rtype

flyteidl.admin.schedule_pb2.FixedRate

verbose_string()

rtype

Text

Attributes

cron_expression

Text

cron_schedule

Schedule.CronSchedule

is_empty

kickoff_time_input_arg

rate

Schedule.FixedRate

schedule_expression