Building a Daily BORME Watchlist with Cloudflare Workers
A hands-on tutorial for running a daily counterparty-event watchlist on Spain's BORME (Boletín Oficial del Registro Mercantil) using Cloudflare Workers, Workers KV, and the Prometiam Risk API. The result is a scheduled Worker (~50 lines of TypeScript) that fires at 09:00 CET on weekdays, pulls yesterday's company events, matches them against a stored watchlist, and posts Slack alerts on hits such as capital changes, director changes, dissolutions, and insolvency.
What the guide covers
- The end-to-end flow: cron trigger calls the /company-events/search endpoint with date_from set to yesterday, matches each event's company number against a KV watchlist, then posts Slack alerts and updates a last-seen event id for deduplication.
- Step 1 — a wrangler.toml with the cron trigger and two KV namespaces (WATCHLIST and STATE).
- Step 2 — the full Worker code, including cursor-based pagination and per-country last-seen tracking so alerts never repeat.
- Step 3 — seeding the watchlist via the wrangler CLI or programmatically from a CRM.
- Step 4 — deploying, setting secrets, and locally testing the scheduled trigger.
Cost and variations
The setup runs on Cloudflare's free tier; Prometiam's Free plan (1,000 calls/month) suits small watchlists and Starter (EUR 9.99/month) adds headroom. The guide also shows multi-country monitoring (ES, FR, GB), Telegram or email delivery, severity tiers, and per-customer alert routing.
Read more · Get a free API key