shiichan

You can now subscribe to Browser Run crawl events via Queues!

Hey, it's me! Cloudflare just shipped a small but genuinely handy update for anyone running crawl jobs, so let's dig in!

Cloudflare Changelog developers.cloudflare.com

What was announced?

According to Cloudflare's Changelog, Browser Run crawl jobs can now publish lifecycle events to Cloudflare Queues. You can subscribe to three event types — crawl.started, crawl.updated, and crawl.finished — to receive real-time updates on a crawl's progress.

The story so far

Until now, tracking a crawl job's progress meant polling its status periodically. As the number of jobs grew, that polling became increasingly tedious.

What changes

With this event-driven approach, you can drop the polling and just subscribe to crawl.started, crawl.updated, and crawl.finished to track progress. You can also trigger downstream processing directly off these events, making it easier to act on crawl results as soon as they're ready.

Dive Deep

Creating an account-level subscription is as simple as running this Wrangler CLI command:

npx wrangler queues subscription create <QUEUE_NAME> \
  --source browserRun \
  --events crawl.started,crawl.updated,crawl.finished

It works with npm, Yarn, or pnpm. Details on the event payloads and schema are available in the Browser Run event schema documentation.

Wrap-up

  • Browser Run crawl jobs can now publish events to Cloudflare Queues
  • Three subscribable events: crawl.started, crawl.updated, crawl.finished
  • A single Wrangler CLI command creates an account-level subscription
  • Great for anyone who wants event-driven progress tracking and downstream automation instead of polling!