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 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

Frequently asked questions

How much does this cost to run?
Cloudflare Workers free tier covers 100,000 requests/day (more than enough for a daily cron). KV free tier is 1 GB storage, 100K reads/day. Prometiam Free tier covers 1,000 calls/month; Starter (€9.99) covers 10,000/month. Total: €0 if your watchlist fits inside the free monthly quota; €9.99/month otherwise.
Can I use this for France or UK too?
Yes. The same /company-events/search endpoint accepts country=FR (BODACC) or country=GB (Companies House). The Worker code below loops across countries.
How do I avoid duplicate alerts?
Each event has a stable id. Store the last-seen event id in KV and only alert on events with id > last-seen. The full code includes this dedup logic.