# flytekit.core.schedule

These classes provide functionality related to schedules.
## Directory

### Classes

| Class | Description |
|-|-|
| [`CronSchedule`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.core.schedule/page.md#flytekitcoreschedulecronschedule) | Use this when you have a launch plan that you want to run on a cron expression. |
| [`FixedRate`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.core.schedule/page.md#flytekitcoreschedulefixedrate) | Use this class to schedule a fixed-rate interval for a launch plan. |
| [`OnSchedule`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.core.schedule/page.md#flytekitcorescheduleonschedule) |  |

### Protocols

| Protocol | Description |
|-|-|
| [`LaunchPlanTriggerBase`](https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.core.schedule/page.md#flytekitcoreschedulelaunchplantriggerbase) |  |

## flytekit.core.schedule.CronSchedule

Use this when you have a launch plan that you want to run on a cron expression.
This uses standard [`cron format`](https://docs.flyte.org/en/latest/concepts/schedules.html#cron-expression-table)
in case where you are using default native scheduler using the schedule attribute.

```

    CronSchedule(
        schedule="*/1 * * * *",  # Following schedule runs every min
    )
```

See the :std:ref:`User Guide &lt;cookbook:cron schedules&gt;` for further examples.

### Parameters

```python
class CronSchedule(
    cron_expression: typing.Optional[str],
    schedule: typing.Optional[str],
    offset: typing.Optional[str],
    kickoff_time_input_arg: typing.Optional[str],
)
```
| Parameter | Type | Description |
|-|-|-|
| `cron_expression` | `typing.Optional[str]` | |
| `schedule` | `typing.Optional[str]` | |
| `offset` | `typing.Optional[str]` | |
| `kickoff_time_input_arg` | `typing.Optional[str]` | |

### Properties

| Property | Type | Description |
|-|-|-|
| `cron_expression` | `None` |  |
| `cron_schedule` | `None` |  |
| `is_empty` | `None` |  |
| `kickoff_time_input_arg` | `None` |  |
| `rate` | `None` |  |
| `schedule_expression` | `None` |  |

### Methods

| Method | Description |
|-|-|
| [`from_flyte_idl()`](#from_flyte_idl) |  |
| [`serialize_to_string()`](#serialize_to_string) |  |
| [`short_string()`](#short_string) |  |
| [`to_flyte_idl()`](#to_flyte_idl) |  |

#### from_flyte_idl()

```python
def from_flyte_idl(
    pb2_object,
)
```
| Parameter | Type | Description |
|-|-|-|
| `pb2_object` |  | |

**Returns:** Schedule

#### serialize_to_string()

```python
def serialize_to_string()
```
#### short_string()

```python
def short_string()
```
**Returns:** Text

#### to_flyte_idl()

```python
def to_flyte_idl()
```
**Returns:** flyteidl.admin.schedule_pb2.Schedule

## flytekit.core.schedule.FixedRate

Use this class to schedule a fixed-rate interval for a launch plan.

```python
from datetime import timedelta

FixedRate(duration=timedelta(minutes=10))
```

See the :std:ref:`fixed rate intervals` chapter in the cookbook for additional usage examples.

### Parameters

```python
class FixedRate(
    duration: datetime.timedelta,
    kickoff_time_input_arg: typing.Optional[str],
)
```
| Parameter | Type | Description |
|-|-|-|
| `duration` | `datetime.timedelta` | |
| `kickoff_time_input_arg` | `typing.Optional[str]` | |

### Properties

| Property | Type | Description |
|-|-|-|
| `cron_expression` | `None` |  |
| `cron_schedule` | `None` |  |
| `is_empty` | `None` |  |
| `kickoff_time_input_arg` | `None` |  |
| `rate` | `None` |  |
| `schedule_expression` | `None` |  |

### Methods

| Method | Description |
|-|-|
| [`from_flyte_idl()`](#from_flyte_idl) |  |
| [`serialize_to_string()`](#serialize_to_string) |  |
| [`short_string()`](#short_string) |  |
| [`to_flyte_idl()`](#to_flyte_idl) |  |

#### from_flyte_idl()

```python
def from_flyte_idl(
    pb2_object,
)
```
| Parameter | Type | Description |
|-|-|-|
| `pb2_object` |  | |

**Returns:** Schedule

#### serialize_to_string()

```python
def serialize_to_string()
```
#### short_string()

```python
def short_string()
```
**Returns:** Text

#### to_flyte_idl()

```python
def to_flyte_idl()
```
**Returns:** flyteidl.admin.schedule_pb2.Schedule

## flytekit.core.schedule.LaunchPlanTriggerBase

```python
protocol LaunchPlanTriggerBase()
```
### Methods

| Method | Description |
|-|-|
| [`to_flyte_idl()`](#to_flyte_idl) |  |

#### to_flyte_idl()

```python
def to_flyte_idl(
    args,
    kwargs,
) -> google.protobuf.message.Message
```
| Parameter | Type | Description |
|-|-|-|
| `args` | `*args` | |
| `kwargs` | `**kwargs` | |

## flytekit.core.schedule.OnSchedule

### Parameters

```python
class OnSchedule(
    schedule: typing.Union[flytekit.core.schedule.CronSchedule, flytekit.core.schedule.FixedRate],
)
```
| Parameter | Type | Description |
|-|-|-|
| `schedule` | `typing.Union[flytekit.core.schedule.CronSchedule, flytekit.core.schedule.FixedRate]` | |

### Methods

| Method | Description |
|-|-|
| [`to_flyte_idl()`](#to_flyte_idl) |  |

#### to_flyte_idl()

```python
def to_flyte_idl()
```

---
**Source**: https://github.com/unionai/unionai-docs/blob/main/content/api-reference/flytekit-sdk/packages/flytekit.core.schedule.md
**HTML**: https://www.union.ai/docs/v1/union/api-reference/flytekit-sdk/packages/flytekit.core.schedule/
