Codiatech Blog

Build a CMS Video Workflow with Cloudflare Stream and Queues

Use Cloudflare Stream events to unlock video previews in your CMS. Test duplicate events, replaced videos and processing failures before rollout.

Workstation illustration showing a video processing event reaching the CMS preview through a queue.

An editor uploads a training video and approves the accompanying article. The upload is complete, but Stream is still preparing a playable version. If the CMS publishes at this point, readers can end up with an empty player. On December 3, 2026, Cloudflare announced that Stream events can be delivered through Queues. A CMS can use those events to track video processing and make the publish action available once the correct video is ready.

Track Video Readiness and Editorial Approval Separately

When the upload starts, record the Stream video ID against the relevant article revision. Give the video its own processing, ready and failed states. The article keeps its editorial workflow. Enable publication only when the current revision has editorial approval and its linked video is ready. If the editor replaces the file, start tracking readiness for the new video ID.

For a first pilot, subscribe to video_state.ready and video_state.errored. Those are the subscription names. In the delivered event, the type field carries the cf.stream. prefix. Use payload.id to find the CMS record. Stream subscriptions operate at account level, so the consumer should update only a video it can match to this CMS. The Stream event subscription reference describes the event fields and payloads.

Make Repeated Events Safe

Cloudflare Queues uses at-least-once delivery, so a message may arrive again. If the current version of the article already has that video marked ready, a repeat delivery should leave the database and editor notifications alone. A conditional update can check the current video ID and article revision in the same database operation. Acknowledge the message after the state change has been durably recorded. If the connection drops after the write, a second attempt should observe the completed transition and stop there.

Test an upload replacement as well. A delayed ready event for the previous file should never mark the new file as ready. Check both the current video ID and its article revision. If two events conflict, reconcile with the current Stream record rather than relying on arrival order. Cloudflare describes redelivery in its Queues delivery guarantees.

Workflow illustration showing repeated video events converging on one CMS state change.

Distinguish Processing Errors from Delivery Failures

A temporary CMS outage is a reason to retry delivery. A video encoding failure is a reason for the editor to inspect or replace the file. Route messages that exhaust configured retries to a dead-letter queue and surface them to an operator. This leaves the affected article gated while the operator checks the issue and decides whether to replay the event.

Log the video identifier, article revision, event type and processing result. If the CMS shows a video processing for longer than expected, reconcile it with the latest Stream record. The supporting batching and retries documentation covers per-message acknowledgement for a Worker consumer. The same CMS state rules also apply if an HTTP pull consumer handles the events.

Four Checks Before Widening the Rollout

  • Confirm that a ready video enables the preview while editorial approval still governs publication.
  • Deliver the same ready event twice and verify that only one state change occurs.
  • Replace a video while it is processing and confirm the old event leaves the new revision alone.
  • Test an encoding failure and a temporary CMS outage. The first should inform the editor, while the second should recover without losing the event.

Start with one content type and a small set of editors. The Cloudflare release note lists the available Stream events. Connecting media processing to an existing editorial workflow is a practical systems integration project.

Primary source: developers.cloudflare.com