Cloudflare Queue Trigger icon

Cloudflare Queue Trigger

Trigger on new messages from Cloudflare Queue (requires paid Workers plan)

Overview

This node acts as a trigger that monitors a Cloudflare Queue for new messages. It periodically polls the specified queue and emits any new messages it retrieves, making it useful for workflows that need to react in real-time or near-real-time to events or data pushed into Cloudflare Queues.

Common scenarios include:

  • Processing tasks or jobs asynchronously by pulling them from a queue.
  • Integrating Cloudflare Workers queues with other systems via n8n automation.
  • Handling event-driven architectures where messages are queued for later processing.

For example, you could use this node to automatically process user-submitted jobs stored in a Cloudflare Queue, triggering downstream workflows whenever new jobs arrive.

Properties

Name Meaning
Queue ID ID of the Cloudflare queue to monitor
Polling Interval How often (in seconds) the node checks for new messages in the queue (minimum 5 seconds)
Batch Size Maximum number of messages to pull at once (between 1 and 100)
Visibility Timeout Time in seconds that pulled messages remain hidden from other consumers before reappearing
Auto Acknowledge Whether to automatically acknowledge messages after successful processing (true/false)
Max Retries Maximum number of times to retry processing failed messages

Output

The node outputs an array of messages pulled from the Cloudflare Queue. Each message is represented as JSON with the following structure:

{
  "id": "string",            // Unique identifier of the message
  "body": {},                // The content/body of the message (JSON)
  "timestamp": 1234567890,   // Timestamp in milliseconds when the message was created
  "attempts": 1,             // Number of attempts made to process this message
  "lease_id": "string"       // Lease identifier used for acknowledging or retrying the message
}

Each emitted item also includes metadata containing the lease_id for internal tracking.

If configured, the node can automatically acknowledge messages after processing, removing them from the queue. Otherwise, messages may be retried based on the max retries setting.

No binary data output is produced by this node.

Dependencies

  • Requires a valid Cloudflare API key credential with permissions to access Cloudflare Queues.
  • The Cloudflare account must have a paid Workers plan enabled to use Queues.
  • Network access to Cloudflare's API endpoints.
  • No additional external dependencies beyond the Cloudflare API.

Troubleshooting

  • Error: "Cloudflare Queues requires a paid Workers plan."
    This indicates the Cloudflare account is on a free plan which does not support Queues. Upgrade your plan to enable this feature.

  • Error: "Invalid API token or Account ID."
    Check that the API token and account ID credentials are correct and have the necessary Queue permissions.

  • Error: "Queue not found."
    Verify that the provided Queue ID exists in your Cloudflare account.

  • Message processing errors and retries:
    If message processing fails, the node retries up to the configured max retries. After exceeding retries, messages are acknowledged to prevent infinite loops.

  • Polling interval too low:
    Setting the polling interval below 5 seconds is not allowed and may cause errors.

Links and References

Discussion