
04 December 2026 · 5 min
Publish course videos with Cloudflare Stream and Queues
The upload is complete, but captions are still missing. Use Cloudflare Stream events to release a lesson when both are ready and avoid duplicate launch emails.




The first lesson has been uploaded. The course platform has already sent the “Watch now” email. Anyone who follows the link sees an empty player. A minute later the video works, but the promised German captions are still missing. The first students have just become your testers.
Since December 3, 2026, Cloudflare Stream can send events directly to Cloudflare Queues. A subscription selects which events reach a queue. A Worker or an HTTP pull consumer processes the messages. For a course platform, two signals are especially useful. The video is playable and the required captions are ready. Cloudflare’s announcement · Stream event subscriptions
Two signals for one release
In this example, the course team releases a lesson once the video can play and the German captions are available. The platform records the Stream video ID when it creates the lesson. When video_state.ready arrives, it marks the video as playable. When caption.ready arrives, it checks the video ID and language. English captions will not satisfy the requirement for a German lesson. If an editor reviews captions, record that approval as a third condition. Cloudflare event schemas
Here is the subscription for an existing queue called course-videos. In the message body the event types also carry the cf.stream prefix. The subscription covers the entire Cloudflare account, so the consumer matches the video ID to a record in its own course platform before updating anything.
npx wrangler queues subscription create course-videos --source stream --events video_state.ready,caption.ready
The release should work whichever message arrives first. Save each fact as it arrives, then check whether the lesson meets every requirement. Until then, the course page can say “Preparing this lesson.” That gives students a useful status and saves support from explaining why an announced video will not play.
Keep a retry from sending a second email
Cloudflare Queues can deliver a message more than once. Imagine the Worker releases the lesson, then loses its connection before acknowledging the message. The next attempt needs to recognise that the release already happened. Cloudflare Queues delivery guarantees
We would record the release and the request to send an email in one database transaction. A unique key made from the lesson and its release version prevents two send requests for the same release. A separate job sends the mail. If the email provider supports idempotency keys, pass the same key on every attempt. That also covers the case where the provider accepts the email and its response gets lost. Without that protection at the delivery boundary, one request in the database alone cannot guarantee one email.
Rehearse the launch with the awkward cases
In a test environment, send the caption event before the video event. Then send both again. The lesson should stay closed until the second requirement is met, and the send log should show one request for that release. Run it once more with a temporary error while saving. Acknowledge the message only after the write succeeds so it can be retried if the write fails. Acknowledgements and retries in Queues
Start with one lesson and one caption language. When the course page can tell the team exactly what is still missing, the team can plan the launch. The same release rule can then cover the rest of the library.



