AutomationClient.create_cron_automation
python
def AutomationClient.create_cron_automation(
name: str,
task: CronTask,
cron_schedules: str | list[str],
cluster: ClusterSlugLike | None = None,
max_retries: int = 0,
*,
workflow: WorkflowReferenceLike | None = None,
) -> AutomationPrototypeCreate an automation that submits a task on one or more cron schedules.
Parameters
name str required Name of the automation to create.
task CronTask required Task to run when the automation is triggered.
cron_schedules str | list[str] required Cron schedule or schedules that trigger the automation.
cluster ClusterSlugLike | None Cluster to run the task on. If not provided, the default cluster is used.
max_retries int Maximum number of retries for the task. Defaults to 0.
workflow Workflow | str | None The workflow to run, as a remote reference or Workflow object. Every triggered job uses this selection. Omit it for a direct runner. A failed lookup raises an error before creation. See Workflow selection. Keyword-only.
Returns
The created automation prototype.