SQS Trigger

Listens to SQS queue and triggers workflows

Overview

This node listens to an AWS SQS (Simple Queue Service) queue and triggers workflows when new messages arrive. It is useful for automating processes that depend on messages from an SQS queue, such as processing tasks, notifications, or data pipelines. For example, it can be used to trigger a workflow whenever a new order message is placed in a queue or to process log messages asynchronously.

Use Case Examples

  1. Trigger a workflow to process customer orders as they arrive in an SQS queue.
  2. Automate notification sending based on messages received in an SQS queue.

Properties

Name Meaning
Queue URL URL of the SQS queue to listen to, required to identify the queue.
Poll Interval Interval in seconds between checks for new messages in the queue.
Wait Time Long polling wait time in seconds (0-20) to reduce empty responses and cost.
Max Number of Messages Maximum number of messages to process at once (1-10).
Visibility Timeout Time in seconds that a message is hidden after being received before returning to the queue if not deleted.
Concurrency Control Method to control concurrent message processing to avoid resource exhaustion.
Max Concurrent Processes Maximum number of messages to process simultaneously, applicable if concurrency control is fixed.
Max CPU Usage % Stop processing new messages when CPU usage exceeds this percentage, applicable if concurrency control is CPU-based.
Max Memory Usage % Stop processing new messages when memory usage exceeds this percentage, applicable if concurrency control is memory-based.
Resource Check Interval How often to check resource usage in seconds, applicable if concurrency control is CPU or memory based.

Output

JSON

  • body - Parsed JSON content of the SQS message body.
  • queueUrl - URL of the SQS queue from which the message was received.
  • messageId - Unique identifier of the SQS message.
  • receiptHandle - Receipt handle used to delete or change the message visibility.
  • attributes - Additional attributes of the SQS message.

Dependencies

  • AWS SDK for JavaScript (SQS client)

Troubleshooting

  • If the node does not receive messages, verify the Queue URL and AWS credentials are correct and have necessary permissions.
  • If messages are not deleted and reappear, check the Visibility Timeout setting and ensure the workflow deletes messages after processing.
  • High CPU or memory usage may pause message processing if concurrency control is set to CPU or memory usage limits; adjust thresholds or concurrency settings accordingly.
  • Common error messages include AWS SDK errors related to authentication or network issues; ensure AWS credentials are valid and network connectivity to AWS is stable.

Links

Discussion