This is part of our commercial offering.

V1CronSchedule

polyaxon.polyflow.schedules.cron.V1CronSchedule(kind='cron', start_at=None, end_at=None, max_runs=None, cron=None, depends_on_past=None)

Cron schedules is an interface to trigger components repeatedly using a cron definition.

  • Args:
    • kind: str, should be equal to cron
    • start_at: datetime, optional
    • end_at: datetime, optional
    • max_runs: int, optional
    • cron: str, required
    • depends_on_past: bool, optional

YAML usage

schedule:
  kind:
  startAt:
  endAt:
  maxRuns:
  cron:
  dependsOnPast:

Python usage

from datetime import datetime
from polyaxon.polyflow import V1CronSchedule
schedule = V1CronSchedule(
  start_at=datetime(...),
  end_at=datetime(...),
  max_runs=20,
  cron="0 0 * * *",
  dependsOnPast=False,
)

Fields

kind

The kind signals to the CLI, client, and other tools that this schedule is a cron schedule.

If you are using the python client to create the schedule, this field is not required and is set by default.

run:
  kind: cron

startAt

Optional field to set the start time for kicking the first execution, all following executions will be relative to this time.

run:
  startAt: "2019-06-24T21:20:07+00:00"

endAt

Optional field to set the end time for stopping this schedule.

run:
  endAt: "2019-06-24T21:20:07+00:00"

maxRuns

The maximum number of times to execute the component. If used with end date, the schedule will terminate if one of the conditions is met.

run:
  maxRuns: 10

cron

The cron expression to generate the component executions.

run:
  cron: "0 0 * * *"

dependsOnPast

Optional field to tell Polyaxon to check if the previous execution was done before scheduling a new one, by default this is set to false.

run:
  dependsOnPast: true