Skip to content
ArticleIntermediate

Use event notification to summarize PDF files on upload

Use R2 event notifications and Queues to summarize PDFs with Workers AI the moment they're uploaded, saving each summary back to the bucket.

Last updated
Oct 12, 2026
Read the original

When a PDF lands in an R2 bucket, an event notification puts a message on a queue; a Worker consumes it, extracts the PDF’s text, summarizes it with Workers AI and writes the summary as a text file to the same bucket.

What you’ll learn

  • Build an upload front end
  • Create a queue and enable R2 event notifications
  • Extract text from a PDF
  • Summarize with Workers AI and store the result in R2

Cloudflare products used

R2, Queues, Workers AI.

Follow the full, step-by-step tutorial in Cloudflare’s documentation.

Keep learning