Use Amazon SQS to send, receive, and delete messages, extend visibility timeouts, and manage queues, attributes, and tags. Batch message actions accept up to 10 entries. Dead-letter actions list source queues and start, inspect, or cancel message move tasks.
A workflow can long-poll for work, process each message, and delete it after success. Receiving a message does not remove it: if processing fails and it is not deleted, it becomes available again after the visibility timeout.
Send and receive messages one at a time or in batches of ten, delete messages, extend visibility timeouts, manage queues along with their attributes and tags, and redrive messages out of a dead-letter queue.
Send a message to an Amazon SQS queue
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key queueUrlstring Yes SQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue ) datajson Yes Message body to send as JSON object (e.g., { "action": "process", "payload": {...} }) delaySecondsnumber No Seconds to delay delivery of this message, 0-900. Not supported per-message on FIFO queues messageAttributesjson No Message attributes keyed by name, each { "dataType": "String" | "Number", "stringValue": "..." }. A custom label such as Number.float is allowed; Binary attributes are not supported messageGroupIdstring No Message group ID for FIFO queues (e.g., "order-processing-group") messageDeduplicationIdstring No Message deduplication ID for FIFO queues (e.g., "order-12345-v1")
Parameter Type Description messagestring Operation status message idstring Message ID md5OfMessageBodystring MD5 digest of the message body, for verifying SQS received it intact md5OfMessageAttributesstring MD5 digest of the message attributes sequenceNumberstring Large, non-consecutive sequence number assigned by a FIFO queue
Send up to 10 messages to an Amazon SQS queue in a single request
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key queueUrlstring Yes SQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue ) entriesarray Yes Up to 10 entries, each { "id": "unique-id", "data": { ... }, "delaySeconds"?, "messageGroupId"?, "messageDeduplicationId"?, "messageAttributes"? }
Parameter Type Description messagestring Operation status message successfularray Entries that were accepted ↳ id string Id supplied for this batch entry ↳ messageId string Message ID assigned by SQS ↳ md5OfMessageBody string MD5 digest of the message body ↳ md5OfMessageAttributes string MD5 digest of the message attributes ↳ sequenceNumber string Sequence number assigned by a FIFO queue failedarray Entries that were rejected ↳ id string Id supplied for this batch entry ↳ senderFault boolean Whether the sender caused the failure ↳ code string Error code for the failure ↳ message string Human-readable failure message successCountnumber Number of messages accepted failureCountnumber Number of messages rejected
Receive up to 10 messages from an Amazon SQS queue, with optional long polling
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key queueUrlstring Yes SQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue ) maxNumberOfMessagesnumber No Maximum number of messages to return, 1-10 (default 1) waitTimeSecondsnumber No Long-poll duration in seconds, 0-20. Waits for a message to arrive before returning (default 0, short poll) visibilityTimeoutnumber No Seconds the returned messages stay hidden from other consumers, 0-43200. Defaults to the queue setting messageAttributeNamesarray No Names of user-defined message attributes to return. Use ["All"] to return all of them messageSystemAttributeNamesarray No System attributes to return: All, SenderId, SentTimestamp, ApproximateReceiveCount, ApproximateFirstReceiveTimestamp, SequenceNumber, MessageDeduplicationId, MessageGroupId, AWSTraceHeader, DeadLetterQueueSourceArn receiveRequestAttemptIdstring No FIFO queues only: deduplication token that lets a retried receive return the same messages (max 128 characters)
Parameter Type Description messagesarray Received messages. Pass a receiptHandle to sqs_delete_message, sqs_delete_message_batch, sqs_change_message_visibility, or sqs_change_message_visibility_batch ↳ messageId string Unique ID SQS assigned to the message ↳ receiptHandle string Handle identifying this receipt of the message, required to delete it ↳ body string Message body as it was sent ↳ md5OfBody string MD5 digest of the message body ↳ md5OfMessageAttributes string MD5 digest of the message attributes ↳ attributes json Requested system attributes as string values keyed by attribute name ↳ messageAttributes json Requested user-defined attributes, each with dataType, stringValue, and stringListValues countnumber Number of messages returned
Delete a received message from an Amazon SQS queue using its receipt handle
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key queueUrlstring Yes SQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue ) receiptHandlestring Yes Receipt handle returned by sqs_receive_message for the message to delete
Parameter Type Description messagestring Operation status message
Delete up to 10 received messages from an Amazon SQS queue in a single request
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key queueUrlstring Yes SQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue ) entriesarray Yes Up to 10 entries, each { "id": "unique-id", "receiptHandle": "..." }. Receipt handles come from sqs_receive_message
Parameter Type Description messagestring Operation status message successfularray Entries that were deleted ↳ id string Id supplied for this batch entry failedarray Entries that were rejected ↳ id string Id supplied for this batch entry ↳ senderFault boolean Whether the sender caused the failure ↳ code string Error code for the failure ↳ message string Human-readable failure message successCountnumber Number of messages deleted failureCountnumber Number of messages rejected
Change how long a received Amazon SQS message stays hidden from other consumers
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key queueUrlstring Yes SQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue ) receiptHandlestring Yes Receipt handle returned by sqs_receive_message for the message to update visibilityTimeoutnumber Yes New visibility timeout in seconds, 0-43200 (12 hours). 0 makes the message immediately visible again
Parameter Type Description messagestring Operation status message
Change the visibility timeout of up to 10 received Amazon SQS messages at once
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key queueUrlstring Yes SQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue ) entriesarray Yes Up to 10 entries, each { "id": "unique-id", "receiptHandle": "...", "visibilityTimeout": 0-43200 }. Receipt handles come from sqs_receive_message
Parameter Type Description messagestring Operation status message successfularray Entries that were updated ↳ id string Id supplied for this batch entry failedarray Entries that were rejected ↳ id string Id supplied for this batch entry ↳ senderFault boolean Whether the sender caused the failure ↳ code string Error code for the failure ↳ message string Human-readable failure message successCountnumber Number of messages updated failureCountnumber Number of messages rejected
List Amazon SQS queue URLs in a region, optionally filtered by name prefix
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key queueNamePrefixstring No Return only queues whose name begins with this string (case-sensitive) maxResultsnumber No Maximum queues to return, 1-1000. Must be set to receive a nextToken (default returns up to 1000) nextTokenstring No Pagination token from a previous request
Parameter Type Description queueUrlsarray Queue URLs returned by the request nextTokenstring Pagination token for the next page of results countnumber Number of queue URLs returned
Resolve an Amazon SQS queue name to its queue URL
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key queueNamestring Yes Queue name, up to 80 characters of letters, digits, hyphens and underscores. A FIFO queue name ends in .fifo queueOwnerAwsAccountIdstring No 12-digit AWS account ID of the queue owner, when the queue belongs to another account
Parameter Type Description queueUrlstring URL of the queue
Read configuration and message-count attributes of an Amazon SQS queue
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key queueUrlstring Yes SQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue ) attributeNamesarray No Attributes to return, e.g. ["All"], ["ApproximateNumberOfMessages"], ["QueueArn"], ["VisibilityTimeout"], ["RedrivePolicy"]. Omitting this returns no attributes
Parameter Type Description attributesjson Queue attributes as string values keyed by attribute name (e.g., ApproximateNumberOfMessages, QueueArn, VisibilityTimeout, RedrivePolicy)
Update configuration attributes of an existing Amazon SQS queue
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key queueUrlstring Yes SQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue ) attributesjson Yes Attributes to set as string values, e.g. { "VisibilityTimeout": "60", "MessageRetentionPeriod": "345600", "RedrivePolicy": "{...}" }. FifoQueue can only be set at creation
Parameter Type Description messagestring Operation status message
Create a standard or FIFO Amazon SQS queue
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key queueNamestring Yes Queue name, up to 80 characters of letters, digits, hyphens and underscores. A FIFO queue name must end in .fifo attributesjson No Queue attributes as string values, e.g. { "FifoQueue": "true", "VisibilityTimeout": "30", "DelaySeconds": "0", "RedrivePolicy": "{...}" } tagsjson No Cost-allocation tags to apply to the new queue, as { "key": "value" } pairs
Parameter Type Description messagestring Operation status message queueUrlstring URL of the created queue
Delete an Amazon SQS queue and every message still in it
Inputs and outputsParameter Type Description messagestring Operation status message
Delete every message in an Amazon SQS queue while keeping the queue itself
Inputs and outputsParameter Type Description messagestring Operation status message
List the Amazon SQS queues that use a given queue as their dead-letter queue
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key queueUrlstring Yes URL of the dead-letter queue whose source queues should be listed maxResultsnumber No Maximum source queues to return, 1-1000. Must be set to receive a nextToken (default returns up to 1000) nextTokenstring No Pagination token from a previous request
Parameter Type Description queueUrlsarray URLs of the source queues that redrive to this dead-letter queue nextTokenstring Pagination token for the next page of results countnumber Number of source queues returned
List the cost-allocation tags attached to an Amazon SQS queue
Inputs and outputsParameter Type Description tagsjson Tags attached to the queue, as string values keyed by tag key
Add or overwrite cost-allocation tags on an Amazon SQS queue
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key queueUrlstring Yes SQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue ) tagsjson Yes Tags to apply as { "key": "value" } pairs. An existing key is overwritten. AWS recommends no more than 50 tags per queue
Parameter Type Description messagestring Operation status message
Remove cost-allocation tags from an Amazon SQS queue
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key queueUrlstring Yes SQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue ) tagKeysarray Yes Tag keys to remove, e.g. ["env", "team"]
Parameter Type Description messagestring Operation status message
Start redriving messages out of an Amazon SQS dead-letter queue
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key sourceArnstring Yes ARN of the dead-letter queue to move messages out of (e.g., arn:aws:sqs:us-east-1:123456789012:my-dlq) destinationArnstring No ARN of the queue to move messages into. Omit to redrive each message to its original source queue maxNumberOfMessagesPerSecondnumber No Throttle the move to at most this many messages per second, up to 500. Omit to move as fast as possible
Parameter Type Description messagestring Operation status message taskHandlestring Handle identifying the move task, accepted by sqs_cancel_message_move_task
List the most recent message move tasks for an Amazon SQS source queue
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key sourceArnstring Yes ARN of the queue whose move tasks should be listed (e.g., arn:aws:sqs:us-east-1:123456789012:my-dlq) maxResultsnumber No Maximum move tasks to return, 1-10 (default 1)
Parameter Type Description resultsarray Move tasks for the source queue ↳ taskHandle string Handle of the task, populated only while its status is RUNNING ↳ status string RUNNING, COMPLETED, CANCELLING, CANCELLED, or FAILED ↳ sourceArn string ARN of the source queue ↳ destinationArn string ARN of the destination queue, absent when redriving to source queues ↳ maxNumberOfMessagesPerSecond number Per-second throttle applied to the move ↳ approximateNumberOfMessagesMoved number Approximate number of messages moved so far ↳ approximateNumberOfMessagesToMove number Approximate number of messages still to move ↳ failureReason string Why the task failed, set only when the status is FAILED ↳ startedTimestamp number Epoch milliseconds when the task started countnumber Number of move tasks returned
Cancel an in-progress Amazon SQS message move task
Inputs and outputsParameter Type Required Description regionstring Yes AWS region (e.g., us-east-1) accessKeyIdstring Yes AWS access key ID secretAccessKeystring Yes AWS secret access key taskHandlestring Yes Task handle returned by sqs_start_message_move_task or sqs_list_message_move_tasks. Only a RUNNING task can be cancelled
Parameter Type Description messagestring Operation status message approximateNumberOfMessagesMovednumber Approximate number of messages already moved before the task was cancelled