AWS SQS Trigger icon

AWS SQS Trigger

Poll AWS SQS for new messages on a schedule

Overview

This node triggers workflows by polling an AWS SQS (Simple Queue Service) queue for new messages on a configurable schedule. It is useful for automating processes that depend on messages arriving in an SQS queue, such as processing tasks, notifications, or data pipelines. For example, it can be used to trigger a workflow whenever new orders are placed in an e-commerce system or to process log messages sent to an SQS queue.

Use Case Examples

  1. Polling an SQS queue every minute to process incoming messages automatically.
  2. Polling an SQS queue once a day to batch process accumulated messages.

Properties

Name Meaning
Poll Times Defines the schedule for polling the SQS queue, including options like every minute, hour, day, week, month, custom cron expressions, or intervals of X minutes/hours.
Queue Name or URL The name or full URL of the AWS SQS queue to poll for messages.
Polling Interval How often to poll the queue for messages, in seconds (between 10 and 3600).
Max Messages Per Poll Maximum number of messages to retrieve per poll (1 to 10).
Visibility Timeout Duration in seconds that received messages are hidden from other retrieve requests (0 to 43200).
Wait Time Seconds Duration in seconds to wait for a message to arrive during long polling (0 to 20).
Auto Delete Messages Whether to automatically delete messages from the queue after processing.
Receive All Available Attributes Whether to receive all available message attributes from the queue.
Options Additional options including stopping polling when the queue is empty and whether to process messages individually or in batches.

Output

JSON

  • messageId - The unique identifier of the SQS message.
  • receiptHandle - The receipt handle used to delete or change the message visibility.
  • body - The content/body of the SQS message.
  • attributes - Attributes of the SQS message.
  • messageAttributes - Custom message attributes sent with the SQS message.
  • md5OfBody - MD5 hash of the message body for integrity verification.

Dependencies

  • AWS SDK for JavaScript (v3) - @aws-sdk/client-sqs

Troubleshooting

  • Ensure AWS credentials are correctly configured with appropriate permissions to access the SQS queue.
  • Verify the queue name or URL is correct and accessible in the specified AWS region.
  • If no messages are received, check if the queue is empty or if the polling interval and wait time are set appropriately.
  • Errors during message deletion may occur if the receipt handle is invalid or expired; ensure messages are deleted only after successful processing.
  • If the node stops polling unexpectedly, verify the 'Stop Polling on Empty Queue' option and queue status.

Links

Discussion