Cloudflare Queue icon

Cloudflare Queue

Send and receive messages using Cloudflare Queues (requires paid Workers plan)

Overview

This node integrates with Cloudflare Queues, allowing users to send, receive, and manage messages within queues hosted on Cloudflare's platform. It is particularly useful for workflows that require asynchronous message processing, task queuing, or distributed event handling.

The Pull operation under the Message resource enables users to retrieve a batch of messages from a specified queue. This is beneficial when you want to process multiple messages at once, such as consuming tasks from a job queue or fetching events for batch processing.

Practical examples:

  • Pulling up to 50 messages from a queue to process them in bulk.
  • Temporarily hiding pulled messages from other consumers by setting a visibility timeout, ensuring exclusive processing.

Properties

Name Meaning
Cloudflare Queues require a Workers Paid plan Notice that Cloudflare Queues require a paid Workers plan; free accounts will get 403 errors.
Queue ID The unique identifier of the queue from which messages will be pulled.
Batch Size Number of messages to pull in one request (between 1 and 100).
Visibility Timeout Duration in seconds that pulled messages remain hidden from other consumers before reappearing if not acknowledged.

Output

The output is an array of JSON objects representing the response from Cloudflare's API for the pulled messages. Each object contains details about the messages retrieved, including their content and metadata such as lease IDs used for acknowledgment or retry operations.

No binary data is output by this operation.

Dependencies

  • Requires a valid Cloudflare API key credential with permissions to access Cloudflare Queues.
  • The Cloudflare account must be on a paid Workers plan; otherwise, API calls will return 403 Forbidden errors.
  • The node uses Cloudflare's REST API endpoint for queues: https://api.cloudflare.com/client/v4/accounts/{accountId}/queues.

Troubleshooting

  • 403 Forbidden Error: Indicates the Cloudflare account is not on a paid Workers plan. Upgrade your plan at https://dash.cloudflare.com/{accountId}/workers/plans.
  • 401 Unauthorized Error: Usually means invalid API token or account ID. Verify credentials and ensure the API token has appropriate Queue permissions.
  • 404 Not Found Error: Could mean the specified queue ID does not exist or the account ID is incorrect. Double-check the queue ID and account information.
  • Batch Size Limits: Ensure the batch size is between 1 and 100; values outside this range may cause errors.
  • Visibility Timeout: Setting this too low might cause messages to become visible again before processing completes, leading to duplicate processing.

Links and References

Discussion