A scheduled AI-powered news digest bot that runs on Cloudflare Workers. Every morning it aggregates articles from configured sources, deduplicates them, summarises them with an LLM, and delivers a digest to Discord and/or WhatsApp.
- A daily cron (default: 08:00 UTC) wakes the agent
- New, unseen articles are collected from all configured sources
- A Cloudflare Workers AI model produces a structured JSON digest
- The digest is delivered to Discord and/or WhatsApp
- Delivered articles are marked as seen (30-day retention) to avoid repeats
- Runtime: Cloudflare Workers + Durable Objects (SQLite state, scheduling)
- AI: Cloudflare Workers AI (
@cf/moonshotai/kimi-k2.5by default) - Scraping:
@cloudflare/puppeteervia Browser Rendering binding - Sources: Hacker News API, RSS/Atom feeds, browser-rendered pages
- Delivery: Discord webhooks, WhatsApp Cloud API
Prerequisites: Node.js, a Cloudflare account with Workers AI, Browser Rendering, and Durable Objects enabled.
npm installConfigure secrets (at least one delivery channel required):
# Discord
wrangler secret put DISCORD_WEBHOOK_URL
# WhatsApp (all three required together)
wrangler secret put WHATSAPP_ACCESS_TOKEN
wrangler secret put WHATSAPP_PHONE_NUMBER_ID
wrangler secret put WHATSAPP_TODeploy:
npm run deploynpm run devTrigger a digest immediately without waiting for the cron:
curl -X POST http://localhost:8787/agents/source-digest-agent/default/triggernpm testEdit wrangler.jsonc to change non-secret settings:
| Variable | Default | Description |
|---|---|---|
MODEL |
@cf/moonshotai/kimi-k2.5 |
Workers AI model for summarisation |
SCRAPE_CRON |
0 8 * * * |
Cron schedule (UTC) |
SKIP_SEEN |
"false" |
Set to "true" to disable deduplication |
Edit src/sources.ts. Three source types are supported:
"hn-api"— Hacker News Firebase API"rss"— RSS 2.0 / Atom feed URL"browser"— Puppeteer-rendered page with heuristic article extraction