Cloudflare Queues logo
Cloudflare R2 logo

Workflow template

Archive queue messages in R2

Save each message body as a JSON file in the chosen R2 bucket, with a distinct object key for each queue and message.

How it works

Archive queue messages in R2

1 Trigger · 1 Action
Cloudflare Queues1 · Trigger

Message received in a queue

Start a workflow when the consumer receives a message from the selected queue.

Cloudflare R22 · Action

Save the message as JSON

Run the R2 S3-compatible PutObject operation.

Before activation

Set up your workflow

  1. Select the queue to archive

    Configure the relay Worker with the FastHook callback and shared secret. Set it as the source queue’s consumer and enter the queue name in the trigger.

  2. Choose the R2 bucket and object key

    Select an R2 connection with write access to your bucket. Keep the file mapped to the queue trigger. The default key is queue-archive/<queue>/<message_id>.json.

  3. Read back an archived message

    Activate the workflow and send a JSON message with a recognizable value. Use the delivery’s message ID to find the object in R2 and compare its JSON with what you sent.

Explore connected apps