AWS SQS Trigger icon

AWS SQS Trigger

Consume queue messages from AWS SQS

Overview

This node acts as a trigger to consume messages from an AWS SQS (Simple Queue Service) queue. It periodically checks the specified SQS queue for new messages and outputs them for further processing in an n8n workflow. This is useful for automating workflows that depend on asynchronous message passing, such as processing orders, notifications, or any event-driven architecture where messages are queued.

Typical use cases include:

  • Automatically processing tasks or jobs submitted to an SQS queue.
  • Integrating AWS SQS with other services by triggering workflows when new messages arrive.
  • Building scalable, event-driven systems that react to messages without polling manually.

Properties

Name Meaning
Queue Name or ID Select the SQS queue from a dropdown list or specify its URL/ID using an expression. The node will listen to this queue for incoming messages.
Interval The frequency at which the node checks the queue for new messages. Must be at least 1 unit.
Unit The time unit for the interval value. Options: Seconds, Minutes, Hours. Defines how often the queue is polled.
Options A collection of additional settings:
- Delete Messages Boolean flag indicating whether messages should be deleted from the queue after being received. Defaults to true.
- Visibility Timeout Duration in seconds that received messages remain hidden from other consumers before becoming visible again. Default is 30 seconds.
- Max Number Of Messages Maximum number of messages to retrieve per poll. SQS may return fewer messages but never more than this number. Default is 1.
- Wait Time Seconds Enables long-polling by waiting up to this many seconds for messages to arrive before returning. Must be between 0 and 20 seconds. Default is 0 (no long-polling).

Output

The node outputs an array of items, each representing a message retrieved from the SQS queue. Each item contains a json field with the full message data as received from AWS SQS, including all attributes and message body.

If multiple messages are received, each is output as a separate item. If no messages are available, no output is emitted during that poll.

The node does not output binary data.

Dependencies

  • Requires valid AWS credentials configured in n8n to access the SQS service.
  • Uses AWS SQS API version 2012-11-05.
  • Relies on network connectivity to AWS endpoints.
  • No additional external dependencies beyond standard AWS authentication.

Troubleshooting

  • Interval too low or zero: Setting the interval below 1 will cause an error. Ensure the interval is at least 1.
  • Wait Time Seconds out of range: Values must be between 0 and 20. Setting outside this range throws an error.
  • Large interval values: Intervals resulting in timeout values exceeding the maximum allowed by JavaScript timers (~2147483647 ms) will cause errors.
  • Invalid queue URL or permissions: If the queue name or URL is incorrect or the AWS credentials lack permission, the node will throw API errors.
  • Message deletion disabled: If "Delete Messages" is false, messages remain in the queue and may be reprocessed multiple times unless handled downstream.
  • Visibility Timeout misconfiguration: Setting visibility timeout too low can cause messages to become visible prematurely, leading to duplicate processing.

Links and References

Discussion