Event Subscriptions for Queues: Wrangler, Event Sources, and Message Schemas
How Cloudflare Queues event subscriptions work, which sources and events you can bind, and how they differ from R2 bucket notifications.
This page summarizes Cloudflare documentation on event subscriptions for Cloudflare Queues: receiving structured messages when activity happens in your account (R2, Workers Builds, Browser Run crawls, and other sources), without polling status APIs. A related but separate path covers R2 event notifications for object-level bucket changes.
Event subscriptions on Queues: what they are and when you need them
Section titled “Event subscriptions on Queues: what they are and when you need them”Event subscriptions on Queues are for when something in your Cloudflare account happens and you want a queue to receive a structured message you can process with a consumer Worker or pull over HTTP.
Event subscriptions allow you to receive messages when events occur across your Cloudflare account. Cloudflare products (e.g., KV, Workers AI, Workers) can publish structured events to a queue, which you can then consume with Workers or HTTP pull consumers to build custom workflows, integrations, or logic.
— Cloudflare, Event subscriptions
An event is a structured record of something happening in your Cloudflare account – like a Workers AI batch request being queued, a Worker build completing, or an R2 bucket being created. When you subscribe to these events, your queue will automatically start receiving messages when the events occur.
— Cloudflare, Event subscriptions — What is an event?
Typical situations: notify Slack when a Workers build fails, start downstream work when a crawl finishes, or react when an R2 bucket is created. Configuration and lifecycle are covered in Manage event subscriptions and event types in Events & schemas.
How event subscriptions differ from R2 bucket event notifications
Section titled “How event subscriptions differ from R2 bucket event notifications”Both paths end at a queue, but they answer different questions.
| Mechanism | Trigger | Typical use | Create with |
|---|---|---|---|
| Queues event subscriptions | Account-level product events (e.g. cf.r2.bucket.created, crawl.finished) |
Integrations across KV, Builds, Browser Run, R2 control plane, etc. | Dashboard Subscriptions tab or wrangler queues subscription create |
| R2 event notifications | Object actions in one bucket (PutObject, DeleteObject, …) |
Post-process uploads, logging, transforms | Dashboard bucket Event notifications or wrangler r2 bucket notification create |
Event notifications send messages to your queue when data in your R2 bucket changes. You can consume these messages with a consumer Worker or pull over HTTP from outside of Cloudflare Workers.
— Cloudflare, Event notifications
R2 notification messages use a different body shape (for example action, bucket, object) than account event subscription payloads with type, source, payload, and metadata. See Message format for R2 and Common schema fields for subscriptions.
Event subscription architecture: queue, source, and consumer
Section titled “Event subscription architecture: queue, source, and consumer”Event subscriptions connect a queue to one or more event sources and event types. Cloudflare publishes matching events to that queue; your app consumes them.
Event subscriptions allow you to receive messages when events occur across your Cloudflare account. Cloudflare products can publish structured events to a queue, which you can then consume with Workers or pull via HTTP from anywhere.
— Cloudflare, Subscribe to events from Cloudflare services with Queues
Push-based consumption (Worker bound as queue consumer) and pull-based HTTP consumption are both valid; see the event notifications for storage reference diagram for R2 object-change flows, which apply the same queue consumption patterns.
Event message schema: type, payload, and metadata
Section titled “Event message schema: type, payload, and metadata”Account-level subscription events share a consistent envelope. Example from the R2 bucket-created event:
{ "type": "cf.r2.bucket.created", "source": { "type": "r2" }, "payload": { "name": "my-bucket", "location": "WNAM" }, "metadata": { "accountId": "f9f79265f388666de8122cfb508d7776", "eventTimestamp": "2025-07-28T10:30:00Z" }}All subscription events also include common fields documented under Events & schemas — Common schema fields: type, source, metadata.accountId, metadata.eventSubscriptionId, metadata.eventSchemaVersion, metadata.eventTimestamp, and payload.
Available event sources: what you can subscribe to today
Section titled “Available event sources: what you can subscribe to today”Sources and per-event schemas are listed on Events & schemas. Changelog and product pages in this cluster name these current event sources for Queues subscriptions:
- R2
- Workers KV
- Workers AI
- Workers Builds
- Vectorize
- Super Slurper
- Workflows
- Browser Run (crawl lifecycle)
- Images (SDK/changelog: typed source interfaces)
More sources and events are noted as coming in Subscribe to events from Cloudflare services with Queues. Product-specific overview pages (for example KV, Workers AI, R2 platform event subscriptions) point back to the same Queues management flow.
Some sources need extra Wrangler flags when creating a subscription (for example --worker-name for workersBuilds.worker, --workflow-name for workflows.workflow, --zone-id and --domain for email sending) per queues subscription create.
Create and manage event subscriptions: dashboard and Wrangler
Section titled “Create and manage event subscriptions: dashboard and Wrangler”Creating a subscription binds a queue to a --source and comma-separated --events. You can create, view, and delete subscriptions from the dashboard or CLI.
Dashboard: Subscriptions tab on a queue
Section titled “Dashboard: Subscriptions tab on a queue”-
In the Cloudflare dashboard, open the Queues page and select your queue.
-
Open the Subscriptions tab.
-
Choose Subscribe to events, name the subscription, and select source and events.
-
Select Subscribe.
To list what is already configured, use the same Subscriptions tab (View existing subscriptions).
Wrangler: queues subscription create and subscription list
Section titled “Wrangler: queues subscription create and subscription list”General form from Manage event subscriptions — Wrangler CLI:
npx wrangler queues subscription create <queue-name> --source <source-type> --events <event1,event2>R2 control-plane example from the announcement:
npx wrangler queues subscription create my-queue --source r2 --events bucket.createdList subscriptions for a queue:
npx wrangler queues subscription list <queue-name>Optional flags include --name, --enabled (default true), and source-specific selectors documented in Wrangler commands — queues subscription create.
The Cloudflare TypeScript SDK adds subscriptions.get() and typed event source interfaces for Queues (changelog — Queues).
Browser Run crawl events: account-level lifecycle without polling
Section titled “Browser Run crawl events: account-level lifecycle without polling”For Browser Run crawl jobs, lifecycle events are published to Queues so you can track progress or trigger downstream work without polling job status.
Use Queues event subscriptions as a push-based alternative to status polling. The linked reference includes setup instructions and payload schemas.
— Cloudflare, Crawl web content — Subscribe to lifecycle events
Browser Run crawl events are account-level. A subscription receives events for all crawl jobs in your account and does not require a source-specific selector.
— Cloudflare, Events & schemas — Browser Run
Event types:
crawl.started— a crawl job startscrawl.updated— a crawled URL changes statuscrawl.finished— a crawl job finishes
Create an account-level subscription (Subscribe to Browser Run crawl events):
npx wrangler queues subscription create <QUEUE_NAME> --source browserRun --events crawl.started,crawl.updated,crawl.finishedPayload examples: Events & schemas — Browser Run.
Workers Builds events: build start, success, fail, and cancel
Section titled “Workers Builds events: build start, success, fail, and cancel”Workers Builds can publish build lifecycle events to a queue; a consumer Worker can forward them to Slack, email, or a webhook.
You can now receive notifications when your Workers’ builds start, succeed, fail, or get cancelled using Event Subscriptions.
— Cloudflare, Get notified when your Workers builds succeed or fail
Workers Builds publishes events to a Queue that your Worker can read messages from, and then send notifications wherever you need — Slack, Discord, email, or any webhook endpoint.
— Cloudflare, Get notified when your Workers builds succeed or fail
Cloudflare documents a deployable Worker template with build status, preview/live URLs, inline errors, and branch/commit/author fields; setup is in the template README linked from that changelog post. Subscriptions that target a specific worker use --worker-name where required (queues subscription create).
R2 object event notifications: prefix, suffix, and queue limits
Section titled “R2 object event notifications: prefix, suffix, and queue limits”When the goal is reacting to objects in a bucket (not account-level bucket.created), use R2 event notifications.
Prerequisites: an R2 bucket, a queue, and a consumer Worker or HTTP pull on that queue (Prerequisites).
Enable with Wrangler (Enable event notifications on your R2 bucket):
npx wrangler r2 bucket notification create <BUCKET_NAME> --event-type <EVENT_TYPE> --queue <QUEUE_NAME>Optional --prefix and --suffix filter which keys trigger notifications. Example from Log and store upload events in R2 with event notifications:
npx wrangler r2 bucket notification create example-upload-bucket --event-type object-create --queue example-event-notification-queueRules and limits (Event notification rules, Notes):
- Up to 100 event notification rules per R2 bucket
- Queue throughput is currently 5,000 messages per second; split rules across queues if you exceed that
- Overlapping rules that could fire twice for one event are not allowed (for example a blanket object-create rule plus a prefixed object-create rule that both match the same upload)
Workflow instance events: WorkflowInstance.subscribe() (not a Queues subscription)
Section titled “Workflow instance events: WorkflowInstance.subscribe() (not a Queues subscription)”Cloudflare Workflows also exposes instance-level streaming via WorkflowInstance.subscribe() and a GET /subscribe API endpoint. This is separate from binding a queue with wrangler queues subscription create, but it solves the same “stop polling” problem for workflow runs.
You can now stream Workflow instance events via WorkflowInstance.subscribe() and the GET /subscribe API endpoint. Workers and HTTP clients can react to workflow and step events, including attempts, sleeps, waits, and rollbacks, without polling for instance status.
— Cloudflare, Stream Workflow instance events
A subscription first streams the entire event history of the Workflow instance. After streaming past events, the subscription waits for new events as the instance runs. You can use filter to receive only specific event types or cursor to start a subscription at a specific event.
— Cloudflare, Stream Workflow instance events
Use filter for specific event types and cursor (last processed eventId) to resume after failures (Subscribe to instance events). The subscription ends on terminal workflow events (workflow_completed, workflow_errored, workflow_terminated); dispose with using or subscription[Symbol.dispose]() (Workers API — subscribe).
Common mistakes with event subscriptions and R2 notifications
Section titled “Common mistakes with event subscriptions and R2 notifications”-
Treating crawl queue events as crawl results — lifecycle messages do not include page content; fetch results after
crawl.finished(Crawl web content). -
Using
queues subscription createfor object uploads — object uploads needwrangler r2 bucket notification create, not an R2 account event type, unless you intentionally want control-plane events likebucket.created(R2 event notifications vs changelog example). -
Conflicting R2 notification rules — duplicate coverage for the same object action is invalid (Notes).
-
Missing source-specific Wrangler flags — Workers Builds, Workflows, Email Sending, and Artifacts sources require the extra options listed in queues subscription create.
-
Assuming Browser Run subscriptions are per-job — subscriptions are account-level for all crawl jobs (Events & schemas — Browser Run).
How to check this on your site
Section titled “How to check this on your site”-
In the Cloudflare dashboard, open Queues, select your queue, and confirm the Subscriptions tab lists the expected source and event types.
-
Run
npx wrangler queues subscription list <queue-name>and compare the output to your intended--sourceand--events(Manage event subscriptions). -
Trigger a known event (for example create a test R2 bucket if subscribed to
bucket.created, or run a Browser Run crawl if subscribed tocrawl.*) and confirm a message arrives at your queue consumer or pull endpoint. -
For R2 object notifications, verify rules under the bucket Event notifications settings and test with a single upload that matches your prefix/suffix filters (Event notifications).
-
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page does not match your experience or the linked Cloudflare docs, email yimasynthetic@gmail.com with the page URL and the exact statement you want clarified.