Skip to content

Commit 8fe7bb6

Browse files
Document cron triggers wrangler config format (#227)
1 parent 2e999bd commit 8fe7bb6

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

products/workers/src/content/cli-wrangler/configuration.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ Keys to configure per project in your `wrangler.toml`.
7474
- `dev` <Type>not inherited</Type> <PropMeta>optional</PropMeta>
7575
- Arguments for `wrangler dev`, configure local server
7676

77+
- `triggers` <Type>inherited</Type> <PropMeta>optional</PropMeta>
78+
- Configures cron triggers for executing a Worker on a schedule
79+
7780
</Definitions>
7881

7982
### vars
@@ -229,6 +232,20 @@ You can learn more about the standard patterns used for include and exclude in t
229232

230233
Workers Sites projects use webpack by default. You can [bring your own webpack config](/cli-wrangler/webpack#using-with-workers-sites), however it is important to be cognizant of your `entry` and `context` settings.
231234

235+
### triggers
236+
237+
A set of cron triggers used to call a Worker on a schedule.
238+
239+
Usage:
240+
241+
```toml
242+
[triggers]
243+
crons = ["0 0 * JAN-JUN FRI", "0 0 LW JUL-DEC *"]
244+
```
245+
246+
- `crons` optional
247+
- A set of cron expressions, where each expression is a separate schedule to run the Worker on.
248+
232249
### dev
233250

234251
Arguments for `wrangler dev` can be configured here so you don't have to repeatedly pass them.

products/workers/src/content/platform/cron-triggers/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Cron Triggers allow users to map a cron expression to a Worker script using a [S
1010

1111
## Adding Cron Triggers
1212

13-
Cron Triggers can be added to scripts with the Cloudflare API or in the dashboard on a [Workers Triggers tab](https://dash.cloudflare.com/?to=/:account/workers) up to the [per-script limit](/platform/limits).
13+
Cron Triggers can be added to scripts with the Cloudflare API, or in the dashboard on a [Workers Triggers tab](https://dash.cloudflare.com/?to=/:account/workers) up to the [per-script limit](/platform/limits). If a script is managed with Wrangler, Cron Triggers should be exclusively managed through the **`wrangler.toml`** file.
1414

1515
![workers-schedule-editor](./media/workers-schedule-editor.png)
1616

0 commit comments

Comments
 (0)