Trigger a Queue When Objects Change

r2

// what it does

Registers an event notification so object creates (or deletes) on the bucket are pushed onto a Queue. A consumer Worker on that Queue then reacts — generate a thumbnail, index the file, kick off a webhook. This is the standard way to run async work after an upload.

// shell

$ wrangler r2 bucket notification create my-bucket --event-type object-create --queue my-queue

// gotcha

Notifications deliver to a Queue, not directly to a Worker — the Queue must already exist (`wrangler queues create`), and you still need a consumer Worker on it to process events. Filter with `--prefix`/`--suffix` to avoid firing on every single object.