Hi I need to run a job daily like cron job <@U06RK...
# ask-ai
a
Hi I need to run a job daily like cron job @ancient-wolf-19325
a
You can schedule a Flyte workflow or task to run daily using a cron expression. In Flyte, this is typically done by creating a LaunchPlan with a
CronSchedule
set to
"0 0 * * *"
(every day at midnight) or by using the
flyte.Trigger.daily()
method for tasks. For example:
Copy code
from flytekit import LaunchPlan, CronSchedule

launch_plan = LaunchPlan.get_or_create(
    wf,
    name="wf_launchplan",
    schedule=CronSchedule(schedule="0 0 * * *"),  # daily at midnight
    default_inputs={"your_input": "value"},
)
or for tasks:
Copy code
daily_trigger = flyte.Trigger("daily_task", flyte.Cron("0 0 * * *"))
@env.task(triggers=daily_trigger)
def my_task(...):
    ...
According to Flyte scheduling docs and Flyte Trigger API, this will run your job daily. Would you like more detail or a full example? Sources: - Flyte scheduling docs - Flyte Trigger API 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.