jackspace/claudeskillz/cloudflare-cron-triggers
- community
Checking that the SKILL.md file is still in the repository.
Complete knowledge domain for Cloudflare Cron Triggers - scheduled execution of Workers using cron expressions for periodic tasks, maintenance jobs, and automated workflows. Use when: scheduling Workers to run periodically, adding cron triggers to Workers, configuring scheduled tasks, testing cron handlers, combining crons with Workflows, enabling Green Compute, handling multiple schedules, or encountering "scheduled handler not found", "cron expression invalid", "changes not propagating", "handler does not export", "timezone issues" errors. Keywords: cloudflare cron, cron triggers, scheduled workers, scheduled handler, periodic tasks, background jobs, scheduled tasks, cron expression, wrangler crons, scheduled event, green compute, workflow triggers, maintenance tasks, scheduled() handler, ScheduledController, UTC timezone
Install
npx vskill@latest install jackspace/claudeskillz/cloudflare-cron-triggersSKILL.md
Cloudflare Cron Triggers
Status: Production Ready ✅ Last Updated: 2025-10-23 Dependencies: cloudflare-worker-base (for Worker setup) Latest Versions: wrangler@4.43.0, @cloudflare/workers-types@4.20251014.0
Quick Start (5 Minutes)
1. Add Scheduled Handler to Your Worker
src/index.ts:
Why this matters:
- Handler must be named exactly
scheduled(notscheduledHandleroronScheduled) - Must be exported in default export object
- Must use ES modules format (not Service Worker format)
2. Configure Cron Trigger in Wrangler
wrangler.jsonc:
CRITICAL:
- Cron expressions use 5 fields:
minute hour day-of-month month day-of-week - All times are UTC only (no timezone conversion)
- Changes take up to 15 minutes to propagate globally
3. Test Locally
Testing tips:
/__scheduledendpoint is only available with--test-scheduledflag- Can pass any cron expression in query parameter
- Python Workers use
/cdn-cgi/handler/scheduledinstead
4. Deploy
After deployment:
- Changes may take up to 15 minutes to propagate
- Check dashboard: Workers & Pages > [Your Worker] > Cron Triggers
- View past executions in Logs tab
Cron Expression Syntax
Five-Field Format
Special Characters
| Character | Meaning | Example | |
|---|---|---|---|
* | Every | * * * * * = every minute | |
, | List | 0,30 * * * * = every hour at :00 and :30 | |
- | Range | 0 9-17 * * * = every hour from 9am-5pm | |
/ | Step | */15 * * * * = every 15 minutes |
Common Patterns
CRITICAL: UTC Timezone Only
- All cron triggers execute on UTC time
- No timezone conversion available
- Convert your local time to UTC manually
- Example: 9am PST = 5pm UTC (next day during DST)
ScheduledController Interface
Properties
controller.cron (string)
The cron expression that triggered this execution.
Use case: Differentiate between multiple cron schedules (see Multiple Cron Triggers pattern).
controller.type (string)
Always returns "scheduled" for cron-triggered executions.
controller.scheduledTime (number)
Unix timestamp (milliseconds since epoch) when this execution was scheduled to run.
Note: This is the scheduled time, not the actual execution time. Due to system load, actual execution may be slightly delayed (usually <1 second).
Execution Context
ctx.waitUntil(promise: Promise<any>)
Extends the execution context to wait for async operations to complete after the handler returns.
Use cases:
- Logging to external services
- Analytics tracking
- Cleanup operations
- Non-critical background tasks
Important: First waitUntil() that fails will be reported as the status in dashboard logs.
Integration Patterns
1. Standalone Scheduled Worker
Best for: Workers that only run on schedule (no HTTP requests)
2. Combined with Hono (Fetch + Scheduled)
Best for: Workers that handle both HTTP requests and scheduled tasks
Why this pattern:
- One Worker handles both use cases
- Share environment bindings
- Reduce number of Workers to manage
- Lower costs (one Worker subscription)
3. Multiple Cron Triggers
Best for: Different schedules for different tasks
wrangler.jsonc:
src/index.ts:
CRITICAL:
- Use exact cron expression match (whitespace sensitive)
- Maximum 3 cron triggers per Worker (Free plan)
- Standard/Paid plan supports more (check limits)
4. Accessing Environment Bindings
All Worker bindings available in scheduled handler:
5. Combining with Workflows
Best for: Multi-step, long-running tasks triggered on schedule
wrangler.jsonc:
src/index.ts:
Why use Workflows:
- Workflows can run for hours (cron handlers have CPU limits)
- Built-in retry and error handling
- State persistence across steps
- Better for complex, multi-step processes
Reference: Cloudflare Workflows Docs
6. Error Handling in Scheduled Handlers
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cloudflare-cron-triggers/SKILL.md
Popularity
- Repository stars
- 12
- Repository forks
- 4
- 7-day trend score
- 13
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 3 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jackspace/claudeskillz/cloudflare-cron-triggers)