---
title: "AutomationClient.create_cron_automation"
description: "Create an automation that submits a task on one or more cron schedules."
image: "https://tilebox.com/images/tilebox-docs-social-preview.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://tilebox.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# AutomationClient.create_cron_automation

import { Fragment } from "astro/jsx-runtime";

import ApiReference from "@docs/components/ApiReference.astro";

import ParamField from "@docs/components/ParamField.astro";

```python
def AutomationClient.create_cron_automation(
    name: str,
    task: CronTask,
    cron_schedules: str | list[str],
    cluster: ClusterSlugLike | None = None,
    max_retries: int = 0,
) -> AutomationPrototype
```

Create an automation that submits a task on one or more cron schedules.

## Parameters

**name**

type: str

required: true

Name of the automation to create.

**task**

type: CronTask

required: true

Task to run when the automation is triggered.

**cron_schedules**

type: str | list[str]

required: true

Cron schedule or schedules that trigger the automation.

**cluster**

type: ClusterSlugLike | None

Cluster to run the task on. If not provided, the default cluster is used.

**max_retries**

type: int

Maximum number of retries for the task. Defaults to `0`.

## Returns

The created automation prototype.

<h2 id="request-example">Usage example</h2>

```python
automation = (
    client.automations().create_cron_automation(
        name="daily-index-refresh",
        task=RefreshIndex(),
        cron_schedules="0 2 * * *",
        cluster="default",
    )
)
```

Source: https://tilebox.com/docs/api-reference/python/tilebox.workflows/AutomationClient.create_cron_automation/index.mdx
