Overview
This node acts as a trigger to consume messages from an AWS SQS (Simple Queue Service) queue. It periodically polls the specified SQS queue for new messages and outputs them as workflow data items. This is useful in scenarios where you want to automate workflows based on incoming messages in an SQS queue, such as processing orders, handling notifications, or integrating with other AWS services.
For example, you could use this node to:
- Automatically process tasks submitted to a queue by other systems.
- Trigger workflows when new messages arrive in a queue used for asynchronous communication.
- Integrate AWS SQS with other applications by forwarding messages to different services.
Properties
| Name | Meaning |
|---|---|
| Queue Name or ID | Select the SQS queue from which to receive messages. You can choose from a list of available queues or specify a queue URL/ID using an expression. |
| Interval | The frequency at which the node checks the queue for new messages. Must be at least 1. |
| Unit | The unit of time for the interval: Seconds, Minutes, or Hours. |
| Options | A collection of additional options to customize message retrieval: |
| - Attribute Names | Which queue attribute names to retrieve. Use "All" to get all attributes. |
| - Delete Messages | Whether to delete messages from the queue after receiving them. Defaults to true. |
| - Max Number Of Messages | Maximum number of messages to retrieve per poll (between 1 and 10). |
| - Message Attribute Names | Which message attribute names to retrieve. Use "All" to get all attributes. |
| - Visibility Timeout | Duration in seconds that received messages are hidden from subsequent receive requests. Defaults to 30 seconds. |
| - Wait Time Seconds | Enables long polling by waiting up to this many seconds (0-20) for messages to arrive before returning. |
Output
The node outputs an array of JSON objects, each representing a received SQS message with the following structure:
{
"messageId": "string",
"receiptHandle": "string",
"body": "string",
"parsedBody": {}, // Parsed JSON object if body is valid JSON, otherwise raw string
"attributes": {}, // Queue message attributes
"messageAttributes": {}, // Custom message attributes
"md5OfBody": "string",
"md5OfMessageAttributes": "string"
}
- Each output item corresponds to one message retrieved from the queue.
- If enabled, messages are deleted from the queue after retrieval.
- No binary data output is produced by this node.
Dependencies
- Requires valid AWS credentials with permissions to access SQS queues.
- Needs configuration of AWS region and authentication via an API key credential or similar.
- Uses AWS SDK v3 for JavaScript internally to interact with SQS.
Troubleshooting
- Interval too low or invalid: The interval must be at least 1; setting it lower will cause an error.
- Wait Time Seconds out of range: Must be between 0 and 20 seconds; otherwise, an error is thrown.
- Large interval values: Intervals resulting in milliseconds greater than 2,147,483,647 will cause an error due to timer limitations.
- AWS permission errors: Ensure the provided AWS credentials have sufficient permissions to list queues, receive messages, and delete messages.
- JSON parsing errors: If message bodies are not valid JSON, the node returns the raw string in
parsedBody. - No messages received: Could be due to empty queue, incorrect queue URL, or visibility timeout settings.