-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Workers: add cron trigger changelog and docs for Python Workers. #21875
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
Conversation
Howdy and thanks for contributing to our repo. The Cloudflare team reviews new, external PRs within two (2) weeks. If it's been two weeks or longer without any movement, please tag the PR Assignees in a comment. We review internal PRs within 1 week. If it's something urgent or has been sitting without a comment, start a thread in the Developer Docs space internally. PR Change SummaryAnnounced the support for cron triggers in Python Workers, enhancing the documentation and changelog accordingly.
Modified Files
Added Files
How can I customize these reviews?Check out the Hyperlint AI Reviewer docs for more information on how to customize the review. If you just want to ignore it on this PR, you can add the Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add |
7e05207
to
18095d4
Compare
@@ -27,7 +27,42 @@ Cron Triggers execute on UTC time. | |||
|
|||
To respond to a Cron Trigger, you must add a [`"scheduled"` handler](/workers/runtime-apis/handlers/scheduled/) to your Worker. | |||
|
|||
<Render file="cron-trigger-example" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what the repercussions of this change are but I seem to recall that we intentionally wanted to move away from inlined examples in the docs to allow testing them properly in case they suddenly break.
Maybe someone with more docs experience can chime in.
f518bea
to
36e2735
Compare
36e2735
to
a300f2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - left one ignorable suggestion
|
||
You can now create Python Workers which are executed via a cron trigger. | ||
|
||
This is similar to how it's done in JavaScript workers, simply define a scheduled event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional - you can link here to remind people of the JS API
src/content/changelog/workers/2025-04-22-python-worker-cron-triggers.mdx
Outdated
Show resolved
Hide resolved
Co-authored-by: ToriLindsay <[email protected]>
Summary
Cron triggers have been recently fixed in Python Workers so let's announce them in our docs and changelog.
Note that Python Workers need to be triggered differently when testing locally. The
/__scheduled
endpoint doesn't work because it relies on wrangler injecting some JavaScript code which is not possible for Python Workers. I spoke with @penalosa about this and it seems the long-term plan is to move to the/cdn-cgi/handler/scheduled
handler eventually anyway, so we may as well point Python Workers devs to it.Documentation checklist