Overview
This node acts as a trigger that monitors an AWS SQS (Simple Queue Service) queue for new messages. When messages arrive in the specified queue, the node retrieves them and triggers the workflow with the message data. It is useful for automating workflows based on asynchronous events or tasks queued in SQS, such as processing orders, handling notifications, or integrating distributed systems.
Typical use cases include:
- Automatically processing jobs or tasks pushed to an SQS queue.
- Triggering workflows when new messages arrive in a messaging system.
- Integrating AWS SQS with other services without manual polling.
Properties
| Name | Meaning |
|---|---|
| Queue URL | The full URL of the AWS SQS queue to monitor for incoming messages. |
| Polling Interval (seconds) | How often (in seconds) the node checks the queue for new messages. Must be between 10 and 300 seconds. |
| Max Messages | Maximum number of messages to retrieve per poll. Can be set from 1 to 10. |
| Delete After Processing | Whether to delete messages from the queue after they have been processed by the workflow. |
Output
The node outputs each received SQS message as a separate item with the following JSON structure:
{
"MessageId": "string",
"Body": "string",
"ReceiptHandle": "string",
"MD5OfBody": "string",
"MessageAttributes": { /* key-value pairs of message attributes */ },
"Attributes": { /* additional message attributes if any */ }
}
MessageId: Unique identifier of the message.Body: The content of the message.ReceiptHandle: Token used to delete the message from the queue.MD5OfBody: MD5 hash of the message body for integrity verification.MessageAttributes: Custom metadata attached to the message.Attributes: Other standard message attributes.
If configured, the node deletes messages from the queue after processing to prevent reprocessing.
Dependencies
- Requires valid AWS credentials with permissions to access SQS queues.
- Needs AWS SDK for JavaScript (
aws-sdkpackage). - The node expects the user to provide an API key credential with accessKeyId, secretAccessKey, and region.
- No additional environment variables are required beyond the AWS credentials.
Troubleshooting
Common issues:
- Incorrect or missing AWS credentials will cause authentication failures.
- Invalid or inaccessible Queue URL will result in errors fetching messages.
- Setting polling interval too low may lead to throttling or excessive API calls.
- Not deleting messages after processing can cause duplicate triggers.
Error messages:
"Error polling SQS:"followed by AWS SDK error details indicates issues connecting or retrieving messages."Failed to delete message:"indicates problems removing messages from the queue, possibly due to invalid receipt handles or permission issues.
Resolutions:
- Verify AWS credentials and their permissions.
- Confirm the Queue URL is correct and accessible.
- Adjust polling interval to a reasonable value (minimum 10 seconds).
- Ensure the IAM role/user has permission to delete messages if deletion is enabled.