Skip to content

Ewc eventhub notifs - #32694

Open
owang-cloud wants to merge 12 commits into
cloudflare:productionfrom
owang-cloud:ewc-eventhub-notifs
Open

Ewc eventhub notifs#32694
owang-cloud wants to merge 12 commits into
cloudflare:productionfrom
owang-cloud:ewc-eventhub-notifs

Conversation

@owang-cloud

Copy link
Copy Markdown

Summary

Adds a Workers source to the event subscriptions schema reference, documenting the seven Worker lifecycle events that can be delivered to a queue: deployment.created, deployment.deleted, version.created, version.deleted, worker.created, worker.updated, and worker.deleted.

Each event gets a description and a full example payload. The reference also covers behavior that is easy to misread from the payloads alone:

  • The Worker name in a payload is the name at the time the event fired, and that name can change. The stable identifier is the script tag in source.id. deployment.created reports the name in workerName, while every other event uses name.
  • version.created fires whenever a version is created, not only on upload. Rollbacks and secret changes copy an existing version and emit the event with no upload.
  • deployment.created annotations use two keys, workers/message and workers/triggered_by. Deployments made through the deployments API always report "workers/triggered_by": "deployment".
  • The versions array on deployment.created is the default traffic split and always sums to 100. Deployments that use cohorts can route traffic to versions that do not appear in versions.
  • changed on worker.updated is keyed by the public Workers API field names rather than the camelCase JSON keys, and previews_base_config reports an empty object so preview secrets stay out of the event.
  • Delivery is at-least-once and unordered, so subscribers should deduplicate on the payload id and sort on metadata.eventTimestamp.

Add a Workers source section to the Queues event subscriptions schemas
page, covering the seven Worker lifecycle events emitted to the Event
Hub: deployment.created, deployment.deleted, version.created,
version.deleted, worker.created, worker.updated, and worker.deleted.

Include notes for behaviour that is easy to misread:

- The payload `name` is the Worker name at the time the event fired and
  can change. The stable identifier is the script tag in `source.id`.
- `changed` on worker.updated lists unversioned config fields using
  snake_case Workers API field names, not the camelCase JSON keys.
- deployment.created `versions` is the default traffic split summing to
  100. Deployments using cohorts can route to versions not listed.
- Delivery is at-least-once and unordered, so deduplicate on the payload
  `id` and sort on metadata.eventTimestamp.
`changed` is an object keyed by the field that changed, not an array of
field names, and it publishes before and after values.

Each value reports `from` and `to` for scalar fields, `added` and
`removed` for set-valued fields such as tags and tail_consumers, and an
empty object for preview_defaults, which changes opaquely. The example
now matches the emitting service's test fixture exactly.

This replaces the earlier claim that values are sorted and de-duplicated
and that no before or after values are included, both of which no longer
hold.
@github-actions github-actions Bot added the product:queues Cloudflare Queues: https://developers.cloudflare.com/queues label Aug 12, 2026
@yomna-shousha

Copy link
Copy Markdown
Contributor

/bonk review

@ask-bonk

ask-bonk Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

LGTM!

github run

Comment thread src/content/partials/queues/event-subscriptions/workers-events.mdx Outdated
Comment thread src/content/partials/queues/event-subscriptions/workers-events.mdx Outdated
Comment thread src/content/partials/queues/event-subscriptions/workers-events.mdx Outdated
Comment thread src/content/partials/queues/event-subscriptions/workers-events.mdx Outdated
Comment thread src/content/partials/queues/event-subscriptions/workers-events.mdx Outdated
Comment thread src/content/partials/queues/event-subscriptions/workers-events.mdx Outdated

@GregBrimble GregBrimble left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering reordering so each resource is in order of typical use/workflow (a Worker is created, a version is created, and a deployment is created):

worker.created, worker.updated, worker.deleted, version.created, version.deleted, deployment.created, deployment.deleted.

owang-cloud and others added 7 commits August 12, 2026 16:49
….mdx

Co-authored-by: Greg Brimble <developer@gregbrimble.com>
….mdx

Co-authored-by: Greg Brimble <developer@gregbrimble.com>
….mdx

Co-authored-by: Greg Brimble <developer@gregbrimble.com>
….mdx

Co-authored-by: Greg Brimble <developer@gregbrimble.com>
….mdx

Co-authored-by: Greg Brimble <developer@gregbrimble.com>
….mdx

Co-authored-by: Greg Brimble <developer@gregbrimble.com>
@owang-cloud
owang-cloud marked this pull request as ready for review August 12, 2026 21:56
@cloudflare-docs-bot

cloudflare-docs-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review

⚠️ 2 warnings, 💡 2 suggestions found in commit aef3e37.

👉 Fix in your agent 👈
Fix the following review findings in PR #32694 (https://github.com/cloudflare/cloudflare-docs/pull/32694).

Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
  or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

After triaging, follow this order:
1. Post a comment on this PR for any findings you are skipping, with the finding ID and your reasoning.
2. Then commit the fixes for the legitimate findings.

The comment must come before the commit — the bot reads PR comments when a new
push triggers a review, so skip comments posted after the push will be missed.

---

## Code Review

### Warnings (1)

#### CR-41539359c74c · Inconsistent payload field name for worker name
- **File:** `src/content/partials/queues/event-subscriptions/workers-events.mdx` line 162
- **Issue:** Most Worker events use `payload.name` for the worker name (e.g., `worker.created` line 15, `worker.updated` line 40, `worker.deleted` line 85, `version.created` line 110, `version.deleted` line 136, and `deployment.deleted` line 205), but `deployment.created` uses `payload.workerName` (line 162).
- **Fix:** Verify the actual event schema and use a consistent field name for the worker name across all events. If `deployment.created` really emits `workerName`, consider updating `deployment.deleted` to match, or vice versa.

---

## Conventions

### Warnings (1)

#### CV-f20d5a36239d · Product or area identified
- **File:** PR-level finding
- **Issue:** The title "Ewc eventhub notifs" does not clearly identify the product, feature, or content area the change affects.
- **Fix:** Rename the title to identify the affected area, e.g. "[Queues] Add Workers lifecycle events to event subscriptions schema reference".

---

## Style Guide Review

### Suggestions (2)

#### SG-fbc3ef46e24f · Serial comma
- **File:** `src/content/partials/queues/event-subscriptions/workers-events.mdx` line 64
- **Issue:** List of seven items is missing the comma before the final conjunction: "`name`, `tags`, `subdomain`, `observability`, `logpush`, `tail_consumers`, and `usage_model`"
- **Fix:** Add a serial comma before `and`: `` `tail_consumers`, and `usage_model` ``

#### SG-8aa0b8c5823e · Short bulleted list
- **File:** `src/content/partials/queues/event-subscriptions/workers-events.mdx` line 68
- **Issue:** Bulleted list has only two items
- **Fix:** Consider rewriting the pair of items as prose instead of a bullet list

Code Review

This code review is in beta and may not always be helpful — use your judgment.

Warnings (1)
File Issue
partials/queues/event-subscriptions/workers-events.mdx line 162 Inconsistent payload field name for worker name — Most Worker events use payload.name for the worker name (e.g., worker.created line 15, worker.updated line 40, worker.deleted line 85, version.created line 110, version.deleted line 136, and deployment.deleted line 205), but deployment.created uses payload.workerName (line 162). Fix: Verify the actual event schema and use a consistent field name for the worker name across all events. If deployment.created really emits workerName, consider updating deployment.deleted to match, or vice versa.

Conventions

Warnings (1)
File Issue
PR Product or area identified — The title "Ewc eventhub notifs" does not clearly identify the product, feature, or content area the change affects. Fix: Rename the title to identify the affected area, e.g. "[Queues] Add Workers lifecycle events to event subscriptions schema reference".

Style Guide Review

Suggestions (2)
File Issue
partials/queues/event-subscriptions/workers-events.mdx line 64 Serial comma — List of seven items is missing the comma before the final conjunction: "name, tags, subdomain, observability, logpush, tail_consumers, and usage_model" Fix: Add a serial comma before and: `tail_consumers`, and `usage_model`
partials/queues/event-subscriptions/workers-events.mdx line 68 Short bulleted list — Bulleted list has only two items Fix: Consider rewriting the pair of items as prose instead of a bullet list
Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.
/ignore-review-limit Permanently lifts the 2-review automatic limit for this PR. Future pushes will trigger reviews as normal.
/disable-auto-review Stops automatic reviews from triggering on future pushes to this PR. Codeowners can still run /review or /full-review manually.
/rebase Rebases the PR branch against production. On conflict, attempts to resolve automatically using AI. Stops with an explanation if confidence is not high enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:queues Cloudflare Queues: https://developers.cloudflare.com/queues size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants