Amazon SQS

Use Amazon SQS to send and receive messages, manage queues, and redrive dead-letter messages.

In Sim, the SQS integration gives your agents both sides of the queue — producing work and consuming it. Supported operations cover:

  • Messages: Send one message or a batch of up to 10, receive with long polling, delete individually or in batches, and extend visibility timeouts while work is still in flight
  • Queues: Create, delete, and purge queues, look up a queue URL by name, and read or update queue attributes
  • Dead-letter handling: List the source queues feeding a dead-letter queue, then start, monitor, and cancel message move tasks to redrive failed messages back
  • Tags: List, add, and remove queue tags for cost allocation and ownership tracking

Because an agent can now drain a queue rather than only fill it, SQS becomes a way to hand work to Sim as well as from it. A workflow can long-poll a queue for jobs, process each message, delete it on success, and let the visibility timeout return anything it fails to finish — the standard reliable-consumer pattern, without running a worker of your own.

Usage Instructions

Integrate Amazon SQS into the workflow. 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.

Actions

SQS Send Message

Send a message to an Amazon SQS queue

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueUrlstringYesSQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue)
datajsonYesMessage body to send as JSON object (e.g., { "action": "process", "payload": {...} })
delaySecondsnumberNoSeconds to delay delivery of this message, 0-900. Not supported per-message on FIFO queues
messageAttributesjsonNoMessage attributes keyed by name, each { "dataType": "String" | "Number", "stringValue": "..." }. A custom label such as Number.float is allowed; Binary attributes are not supported
messageGroupIdstringNoMessage group ID for FIFO queues (e.g., "order-processing-group")
messageDeduplicationIdstringNoMessage deduplication ID for FIFO queues (e.g., "order-12345-v1")

Output

ParameterTypeDescription
messagestringOperation status message
idstringMessage ID
md5OfMessageBodystringMD5 digest of the message body, for verifying SQS received it intact
md5OfMessageAttributesstringMD5 digest of the message attributes
sequenceNumberstringLarge, non-consecutive sequence number assigned by a FIFO queue

SQS Send Message Batch

Send up to 10 messages to an Amazon SQS queue in a single request

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueUrlstringYesSQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue)
entriesarrayYesUp to 10 entries, each { "id": "unique-id", "data": { ... }, "delaySeconds"?, "messageGroupId"?, "messageDeduplicationId"?, "messageAttributes"? }

Output

ParameterTypeDescription
messagestringOperation status message
successfularrayEntries that were accepted
idstringId supplied for this batch entry
messageIdstringMessage ID assigned by SQS
md5OfMessageBodystringMD5 digest of the message body
md5OfMessageAttributesstringMD5 digest of the message attributes
sequenceNumberstringSequence number assigned by a FIFO queue
failedarrayEntries that were rejected
idstringId supplied for this batch entry
senderFaultbooleanWhether the sender caused the failure
codestringError code for the failure
messagestringHuman-readable failure message
successCountnumberNumber of messages accepted
failureCountnumberNumber of messages rejected

SQS Receive Message

Receive up to 10 messages from an Amazon SQS queue, with optional long polling

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueUrlstringYesSQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue)
maxNumberOfMessagesnumberNoMaximum number of messages to return, 1-10 (default 1)
waitTimeSecondsnumberNoLong-poll duration in seconds, 0-20. Waits for a message to arrive before returning (default 0, short poll)
visibilityTimeoutnumberNoSeconds the returned messages stay hidden from other consumers, 0-43200. Defaults to the queue setting
messageAttributeNamesarrayNoNames of user-defined message attributes to return. Use ["All"] to return all of them
messageSystemAttributeNamesarrayNoSystem attributes to return: All, SenderId, SentTimestamp, ApproximateReceiveCount, ApproximateFirstReceiveTimestamp, SequenceNumber, MessageDeduplicationId, MessageGroupId, AWSTraceHeader, DeadLetterQueueSourceArn
receiveRequestAttemptIdstringNoFIFO queues only: deduplication token that lets a retried receive return the same messages (max 128 characters)

Output

ParameterTypeDescription
messagesarrayReceived messages. Pass a receiptHandle to sqs_delete_message, sqs_delete_message_batch, sqs_change_message_visibility, or sqs_change_message_visibility_batch
messageIdstringUnique ID SQS assigned to the message
receiptHandlestringHandle identifying this receipt of the message, required to delete it
bodystringMessage body as it was sent
md5OfBodystringMD5 digest of the message body
md5OfMessageAttributesstringMD5 digest of the message attributes
attributesjsonRequested system attributes as string values keyed by attribute name
messageAttributesjsonRequested user-defined attributes, each with dataType, stringValue, and stringListValues
countnumberNumber of messages returned

SQS Delete Message

Delete a received message from an Amazon SQS queue using its receipt handle

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueUrlstringYesSQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue)
receiptHandlestringYesReceipt handle returned by sqs_receive_message for the message to delete

Output

ParameterTypeDescription
messagestringOperation status message

SQS Delete Message Batch

Delete up to 10 received messages from an Amazon SQS queue in a single request

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueUrlstringYesSQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue)
entriesarrayYesUp to 10 entries, each { "id": "unique-id", "receiptHandle": "..." }. Receipt handles come from sqs_receive_message

Output

ParameterTypeDescription
messagestringOperation status message
successfularrayEntries that were deleted
idstringId supplied for this batch entry
failedarrayEntries that were rejected
idstringId supplied for this batch entry
senderFaultbooleanWhether the sender caused the failure
codestringError code for the failure
messagestringHuman-readable failure message
successCountnumberNumber of messages deleted
failureCountnumberNumber of messages rejected

SQS Change Message Visibility

Change how long a received Amazon SQS message stays hidden from other consumers

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueUrlstringYesSQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue)
receiptHandlestringYesReceipt handle returned by sqs_receive_message for the message to update
visibilityTimeoutnumberYesNew visibility timeout in seconds, 0-43200 (12 hours). 0 makes the message immediately visible again

Output

ParameterTypeDescription
messagestringOperation status message

SQS Change Message Visibility Batch

Change the visibility timeout of up to 10 received Amazon SQS messages at once

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueUrlstringYesSQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue)
entriesarrayYesUp to 10 entries, each { "id": "unique-id", "receiptHandle": "...", "visibilityTimeout": 0-43200 }. Receipt handles come from sqs_receive_message

Output

ParameterTypeDescription
messagestringOperation status message
successfularrayEntries that were updated
idstringId supplied for this batch entry
failedarrayEntries that were rejected
idstringId supplied for this batch entry
senderFaultbooleanWhether the sender caused the failure
codestringError code for the failure
messagestringHuman-readable failure message
successCountnumberNumber of messages updated
failureCountnumberNumber of messages rejected

SQS List Queues

List Amazon SQS queue URLs in a region, optionally filtered by name prefix

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueNamePrefixstringNoReturn only queues whose name begins with this string (case-sensitive)
maxResultsnumberNoMaximum queues to return, 1-1000. Must be set to receive a nextToken (default returns up to 1000)
nextTokenstringNoPagination token from a previous request

Output

ParameterTypeDescription
queueUrlsarrayQueue URLs returned by the request
nextTokenstringPagination token for the next page of results
countnumberNumber of queue URLs returned

SQS Get Queue URL

Resolve an Amazon SQS queue name to its queue URL

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueNamestringYesQueue name, up to 80 characters of letters, digits, hyphens and underscores. A FIFO queue name ends in .fifo
queueOwnerAwsAccountIdstringNo12-digit AWS account ID of the queue owner, when the queue belongs to another account

Output

ParameterTypeDescription
queueUrlstringURL of the queue

SQS Get Queue Attributes

Read configuration and message-count attributes of an Amazon SQS queue

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueUrlstringYesSQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue)
attributeNamesarrayNoAttributes to return, e.g. ["All"], ["ApproximateNumberOfMessages"], ["QueueArn"], ["VisibilityTimeout"], ["RedrivePolicy"]. Omitting this returns no attributes

Output

ParameterTypeDescription
attributesjsonQueue attributes as string values keyed by attribute name (e.g., ApproximateNumberOfMessages, QueueArn, VisibilityTimeout, RedrivePolicy)

SQS Set Queue Attributes

Update configuration attributes of an existing Amazon SQS queue

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueUrlstringYesSQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue)
attributesjsonYesAttributes to set as string values, e.g. { "VisibilityTimeout": "60", "MessageRetentionPeriod": "345600", "RedrivePolicy": "{...}" }. FifoQueue can only be set at creation

Output

ParameterTypeDescription
messagestringOperation status message

SQS Create Queue

Create a standard or FIFO Amazon SQS queue

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueNamestringYesQueue name, up to 80 characters of letters, digits, hyphens and underscores. A FIFO queue name must end in .fifo
attributesjsonNoQueue attributes as string values, e.g. { "FifoQueue": "true", "VisibilityTimeout": "30", "DelaySeconds": "0", "RedrivePolicy": "{...}" }
tagsjsonNoCost-allocation tags to apply to the new queue, as { "key": "value" } pairs

Output

ParameterTypeDescription
messagestringOperation status message
queueUrlstringURL of the created queue

SQS Delete Queue

Delete an Amazon SQS queue and every message still in it

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueUrlstringYesSQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue)

Output

ParameterTypeDescription
messagestringOperation status message

SQS Purge Queue

Delete every message in an Amazon SQS queue while keeping the queue itself

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueUrlstringYesSQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue)

Output

ParameterTypeDescription
messagestringOperation status message

SQS List Dead-Letter Source Queues

List the Amazon SQS queues that use a given queue as their dead-letter queue

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueUrlstringYesURL of the dead-letter queue whose source queues should be listed
maxResultsnumberNoMaximum source queues to return, 1-1000. Must be set to receive a nextToken (default returns up to 1000)
nextTokenstringNoPagination token from a previous request

Output

ParameterTypeDescription
queueUrlsarrayURLs of the source queues that redrive to this dead-letter queue
nextTokenstringPagination token for the next page of results
countnumberNumber of source queues returned

SQS List Queue Tags

List the cost-allocation tags attached to an Amazon SQS queue

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueUrlstringYesSQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue)

Output

ParameterTypeDescription
tagsjsonTags attached to the queue, as string values keyed by tag key

SQS Tag Queue

Add or overwrite cost-allocation tags on an Amazon SQS queue

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueUrlstringYesSQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue)
tagsjsonYesTags to apply as { "key": "value" } pairs. An existing key is overwritten. AWS recommends no more than 50 tags per queue

Output

ParameterTypeDescription
messagestringOperation status message

SQS Untag Queue

Remove cost-allocation tags from an Amazon SQS queue

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
queueUrlstringYesSQS queue URL (e.g., https://sqs.us-east-1.amazonaws.com/123456789012/my-queue)
tagKeysarrayYesTag keys to remove, e.g. ["env", "team"]

Output

ParameterTypeDescription
messagestringOperation status message

SQS Start Message Move Task

Start redriving messages out of an Amazon SQS dead-letter queue

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
sourceArnstringYesARN of the dead-letter queue to move messages out of (e.g., arn:aws:sqs:us-east-1:123456789012:my-dlq)
destinationArnstringNoARN of the queue to move messages into. Omit to redrive each message to its original source queue
maxNumberOfMessagesPerSecondnumberNoThrottle the move to at most this many messages per second, up to 500. Omit to move as fast as possible

Output

ParameterTypeDescription
messagestringOperation status message
taskHandlestringHandle identifying the move task, accepted by sqs_cancel_message_move_task

SQS List Message Move Tasks

List the most recent message move tasks for an Amazon SQS source queue

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
sourceArnstringYesARN of the queue whose move tasks should be listed (e.g., arn:aws:sqs:us-east-1:123456789012:my-dlq)
maxResultsnumberNoMaximum move tasks to return, 1-10 (default 1)

Output

ParameterTypeDescription
resultsarrayMove tasks for the source queue
taskHandlestringHandle of the task, populated only while its status is RUNNING
statusstringRUNNING, COMPLETED, CANCELLING, CANCELLED, or FAILED
sourceArnstringARN of the source queue
destinationArnstringARN of the destination queue, absent when redriving to source queues
maxNumberOfMessagesPerSecondnumberPer-second throttle applied to the move
approximateNumberOfMessagesMovednumberApproximate number of messages moved so far
approximateNumberOfMessagesToMovenumberApproximate number of messages still to move
failureReasonstringWhy the task failed, set only when the status is FAILED
startedTimestampnumberEpoch milliseconds when the task started
countnumberNumber of move tasks returned

SQS Cancel Message Move Task

Cancel an in-progress Amazon SQS message move task

Input

ParameterTypeRequiredDescription
regionstringYesAWS region (e.g., us-east-1)
accessKeyIdstringYesAWS access key ID
secretAccessKeystringYesAWS secret access key
taskHandlestringYesTask handle returned by sqs_start_message_move_task or sqs_list_message_move_tasks. Only a RUNNING task can be cancelled

Output

ParameterTypeDescription
messagestringOperation status message
approximateNumberOfMessagesMovednumberApproximate number of messages already moved before the task was cancelled