Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explain slugs in schedules docs #17029

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/v3/automate/add-schedules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ Just add the keyword argument `cron`, `interval`, or `rrule`.
| `cron` | A cron schedule string of when to execute runs of this deployment. Also accepts an iterable of cron schedule strings to create multiple schedules. |
| `rrule` | An rrule schedule string of when to execute runs of this deployment. Also accepts an iterable of rrule schedule strings to create multiple schedules. |
| `schedules` | A list of schedule objects defining when to execute runs of this deployment. Used to define multiple schedules or additional scheduling options such as `timezone`. |
| `schedule` | A schedule object defining when to execute runs of this deployment. Used to define additional scheduling options such as `timezone`. |
| `schedule` | A schedule object defining when to execute runs of this deployment. Used to define additional scheduling options such as `timezone`. |
| `slug` | An optional unique identifier for the schedule containing only lowercase letters, numbers, and hyphens. If not provided for a given schedule, the schedule will be unnamed. |

The `serve` method below will create a deployment of `my_flow` with a cron schedule that creates runs every minute of every day:

Expand Down Expand Up @@ -116,12 +117,15 @@ deployments:
...
schedules:
- cron: "0 0 * * *"
slug: "chicago-schedule"
timezone: "America/Chicago"
active: false
- cron: "0 12 * * *"
slug: "new-york-schedule"
timezone: "America/New_York"
active: true
- cron: "0 18 * * *"
slug: "london-schedule"
timezone: "Europe/London"
active: true
```
Expand Down Expand Up @@ -319,10 +323,12 @@ send_email.serve(
schedules=[
Cron(
"0 8 * * *",
slug: "jim-email",
parameters={"to": "[email protected]"}
),
Cron(
"5 8 * * *",
slug: "dwight-email",
parameters={
"to": "[email protected]",
"message": "Stop goofing off! You're assistant _to_ the regional manager!"
Expand Down Expand Up @@ -353,9 +359,11 @@ deployments:
entrypoint: send_email_flow.py:send_email
schedules:
- cron: "0 8 * * *"
slug: "jim-email"
parameters:
to: "[email protected]"
- cron: "5 8 * * *"
slug: "dwight-email"
parameters:
to: "[email protected]"
message: "Stop goofing off! You're assistant _to_ the regional manager!"
Expand Down