Miadi Review

[ep548.Cloudflare] Engineering Serverless Event Pipelines with Cloudflare Queues and Slack

Sep 30, 2026 · model: manual-edit · channel: webdecoded

Watch source

In the chronicle

Engineering Serverless Event Pipelines with Cloudflare Queues and Slack

Source: Build Cloudflare Queues - scaling out your app & deploying large batch processes — webdecoded
https://youtu.be/h7sXGgQDBHA
⟐ ep 548 Before Choosing a Broker: Preparing the Question Together

Summary

This tutorial demonstrates the implementation of a decoupled asynchronous processing architecture using Cloudflare Queues and Workers. The presenter builds a producer worker to ingest incoming HTTP payloads and enqueue jobs, followed by a consumer worker that batches events and dispatches automated notifications to a Slack channel via Slack's Web API, verifying both local dev and production deployments.

Aspects

Producer-Consumer Queue Paradigm (00:00-02:15)

Queues decouple background tasks like emails, report generation, and third-party rate-limited API calls from synchronous HTTP response cycles. Producers enqueue messages, while consumers asynchronously consume and process single or batched tasks.

Cloudflare Queue Setup and Worker Initialization (02:40-04:30)

A queue is provisioned through the Cloudflare dashboard. Using create-cloudflare (C3), a local JavaScript Worker project is bootstrapped, providing the runtime foundation and Wrangler configuration for queue bindings.

Configuring Producer Bindings and Enqueue Logic (05:00-07:45)

The producer Worker binds the queue via wrangler.toml and handles incoming POST requests. It extracts payload data such as order items and customer IDs, then pushes message objects directly onto the queue using env bindings.

Consumer Handler and Batch Processing (07:50-09:35)

The consumer Worker exports an async queue handler that receives batched messages. Batch sizing (max_batch_size) and wait timeouts (max_batch_timeout) are tuned in wrangler.toml to optimize throughput and execution frequency.

Slack API Setup and Environment Secrets (15:43-19:25)

A Slack application is configured with chat:write permissions, installed to a workspace, and issued a Bot OAuth token. The secret token is stored locally in .dev.vars and securely deployed to Cloudflare environment variables.

End-results and Core Aspect

Core Aspect — Asynchronous Webhook-to-Slack Event Pipeline (22:30-26:47)

The pipeline ingests HTTP order events via a producer Worker, queues them asynchronously on Cloudflare Queues, and triggers a consumer Worker to batch process the messages and dispatch automated notifications to Slack channels via REST API calls.

Results

  • Validated Local Message Consumption (13:30-15:42): Executing wrangler dev and wrangler tail validates that simulated HTTP POST requests enqueue properly and trigger the local consumer handler to parse and log incoming order payloads.
  • Automated Slack Notification Dispatch (24:50-25:33): The consumer Worker formats ingested order items into an automated Slack message and successfully posts alerts to a designated workspace channel using Bearer token authentication.
  • End-to-End Production Deployment (25:40-26:47): Deploying the complete pipeline with npx wrangler deploy and setting Cloudflare dashboard environment variables enables public API endpoints to reliably push queue events straight into Slack.

—-

Vocabulary

Event Producer

An event producer is a component, service, or client application that creates and publishes messages (events) to a message broker like Cloudflare Queues.

How It Works

• Creation: The producer detects or generates an action (e.g., a user signing up, an item added to a cart, or an R2 file upload). • Publishing: It connects to the queue via a binding or API and sends the structured data payload into the broker. • Decoupling: The producer hands off the message and moves on immediately. It does not wait for the final processing to finish, keeping the main application fast and responsive

Questions

What will be the most simple application of producing an event in miadi ?

  • {{ TODO by agents }}
The Slack application what could we do with that ?
  • i’m really curious what that about and how it could enable communication between our platform, and that message system. I know that Iris is connected to slack …