Overview
This node triggers an n8n workflow whenever new messages are received from an Amazon Web Services (AWS) Simple Queue Service (SQS) queue. It periodically polls the specified SQS queue at a user-defined interval and emits each received message as output. This is useful for automating workflows that depend on asynchronous message processing, such as order processing systems, notification dispatchers, or any event-driven architecture where messages are queued in AWS SQS.
Practical examples:
- Automatically process orders placed on an e-commerce platform by listening to an SQS queue where order messages are sent.
- Trigger notifications or alerts when specific events are pushed into an SQS queue.
- Integrate with other AWS services by reacting to messages queued by Lambda functions or other producers.
Properties
| Name | Meaning |
|---|---|
| Queue Name or ID | Select the AWS SQS queue to monitor. The list is dynamically loaded from your AWS account. |
| Interval | The numeric value defining how often the queue will be checked for new messages. |
| Unit | The unit of time for the interval; can be either "Seconds" or "Minutes". |
| Options: Delete Messages | Whether to delete messages from the queue after receiving them. Defaults to true. |
| Options: Visibility Timeout | Duration in seconds that received messages remain hidden from other retrieval requests (0-43200). |
| Options: Max Messages | Maximum number of messages to retrieve per poll (between 1 and 10). |
| Options: Wait Time Seconds | Duration in seconds for long polling; how long the call waits for messages to arrive (0-20). |
Output
The node outputs each received SQS message as a separate JSON object with the following structure:
{
"MessageId": "string",
"Body": "string",
"ReceiptHandle": "string",
"MD5OfBody": "string",
"MessageAttributes": { /* key-value pairs of message attributes */ },
"Attributes": { /* additional message attributes */ },
"QueueUrl": "string"
}
MessageId: Unique identifier of the message.Body: The content of the message.ReceiptHandle: Identifier used to delete or change the visibility of the message.MD5OfBody: MD5 hash of the message body for integrity verification.MessageAttributes: Custom metadata attached to the message.Attributes: Additional system attributes of the message.QueueUrl: URL of the SQS queue from which the message was received.
If configured to delete messages, the node removes them from the queue after processing. The node does not output binary data.
Dependencies
- Requires valid AWS credentials with permissions to access SQS queues.
- Needs an API key credential configured in n8n for AWS authentication.
- Uses AWS SDK for JavaScript v3 (
@aws-sdk/client-sqs) internally. - The node requires network access to AWS SQS endpoints.
Troubleshooting
- Failed to load queues: This error occurs if the node cannot fetch the list of available SQS queues. Check that the AWS credentials are correct and have permission to list SQS queues.
- Error polling SQS: Indicates issues during message retrieval, possibly due to network problems, incorrect queue URL, or insufficient permissions.
- Failed to delete message: Happens if the node tries to delete a message but lacks permission or the receipt handle is invalid. Ensure the AWS credentials allow deleting messages.
- If no messages are received, verify that the queue contains messages and that the polling interval and wait time settings are appropriate.
- Long polling (
Wait Time Seconds) helps reduce empty responses and costs; setting it too low may cause frequent empty polls.