skillfed

cloudflare-cron-triggers

Cloudflare Cron Triggers enables you to schedule periodic execution of Cloudflare Workers using standard cron syntax. Configure triggers in wrangler.jsonc, implement a scheduled handler in your Worker code, and test locally before deployment—all times run in UTC.

Cloudflare Cron Triggers lets you schedule periodic Worker execution using cron expressions in wrangler configuration.

AI-generated summary based on this skill's SKILL.md

196 29 MIT updated by secondsky

Install

secondsky/claude-skills/cloudflare-cron-triggers · repository language: TypeScript

git clone https://github.com/secondsky/claude-skills
cp -r claude-skills/plugins/cloudflare-cron-triggers/skills/cloudflare-cron-triggers ~/.claude/skills/cloudflare-cron-triggers
npx skillfed install secondsky/claude-skills/cloudflare-cron-triggers

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I set up cron jobs in cloudflare workers?

Cloudflare Cron Triggers lets you schedule periodic Worker execution using standard cron syntax. Define your cron expressions in the `[env.*.triggers.crons]` section of wrangler.jsonc, then export a `scheduled` handler in your Worker code to process each trigger. All times run in UTC. Deploy with `wrangler deploy` and your scheduled tasks will execute automatically on the defined schedule.

What is the cron expression syntax for cloudflare?

Cloudflare Cron Triggers uses standard Unix cron syntax: five fields representing minute, hour, day of month, month, and day of week (0–6, where 0 is Sunday). For example, `0 9 * * 1` runs at 9:00 AM UTC every Monday. Cloudflare Cron Triggers supports wildcards (*), ranges (1-5), steps (*/15), and lists (1,3,5). Verify your expressions before deployment to ensure correct scheduling.

Why are my cron triggers not working?

Cloudflare Cron Triggers may fail to execute if your scheduled handler is not properly exported, cron expressions contain syntax errors, or propagation delays occur after deployment. Verify your handler signature matches `export default { scheduled(event) { ... } }`, test locally with `wrangler dev`, and check that all cron patterns are valid. Allow a few minutes for triggers to propagate after deployment.

How do I test cron handlers locally and validate timezone conversions?

Cloudflare Cron Triggers supports local testing via `wrangler dev`, which simulates scheduled events. Use the Wrangler CLI to trigger test executions and verify your handler logic. Since all Cloudflare Cron Triggers times run in UTC, convert your desired local time to UTC before configuring expressions. Log timestamps in your handler to confirm execution times match expectations.

Can I integrate cron triggers with bindings and error handling?

Yes, Cloudflare Cron Triggers handlers can access bindings like databases, KV stores, and Durable Objects through the context parameter. Implement try-catch blocks in your scheduled handler to manage errors gracefully. Return appropriate status codes and log failures for monitoring. Bindings are injected the same way as in HTTP handlers, enabling seamless integration with your Worker infrastructure.

What is the scheduled() handler in cloudflare workers?

Cloudflare Cron Triggers uses the `scheduled()` handler to define code that runs on your cron schedule. Export it as part of your default export: `export default { scheduled(event) { ... } }`. The handler receives a ScheduledEvent object containing the cron trigger metadata. This is where you implement your periodic task logic, whether sending notifications, cleaning up data, or syncing external systems.

SKILL.md

rendered from the published skill — quoted content, verbatim

Cloudflare Cron Triggers

Status: Production Ready ✅ Last Updated: 2025-11-25 Dependencies: cloudflare-worker-base (for Worker setup) Latest Versions: wrangler@4.50.0, @cloudflare/workers-types@4.20251125.0


Quick Start (5 Minutes)

1. Add Scheduled Handler to Your Worker

src/index.ts:

```typescript export default { async scheduled( controller: ScheduledController, env: Env, ctx: ExecutionContext ): Promise<void> { console.log('Cron job executed at:', new Date(controller.scheduledTime));

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 11 files
plugins/cloudflare-cron-triggers/skills/cloudflare-cron-triggers/SKILL.md
plugins/cloudflare-cron-triggers/skills/cloudflare-cron-triggers/references/common-patterns.md
plugins/cloudflare-cron-triggers/skills/cloudflare-cron-triggers/references/cron-expressions-reference.md
plugins/cloudflare-cron-triggers/skills/cloudflare-cron-triggers/references/integration-patterns.md
plugins/cloudflare-cron-triggers/skills/cloudflare-cron-triggers/references/testing-guide.md
plugins/cloudflare-cron-triggers/skills/cloudflare-cron-triggers/references/wrangler-config.md
plugins/cloudflare-cron-triggers/skills/cloudflare-cron-triggers/templates/basic-scheduled.ts
plugins/cloudflare-cron-triggers/skills/cloudflare-cron-triggers/templates/hono-with-scheduled.ts
plugins/cloudflare-cron-triggers/skills/cloudflare-cron-triggers/templates/multiple-crons.ts
plugins/cloudflare-cron-triggers/skills/cloudflare-cron-triggers/templates/scheduled-with-bindings.ts
plugins/cloudflare-cron-triggers/skills/cloudflare-cron-triggers/templates/wrangler-cron-config.jsonc

Related skills

Tags

task-scheduling background-jobs time-based-automation edge-computing serverless-cron worker-orchestration deployment-config carbon-aware-compute