SQS
Start agents from messages in an Amazon SQS queue, or send run results to a queue.
On this page
| Modes | Inbound, outbound |
| YAML type | sqs |
| Credentials | A Connection of type sqs with the AWS access keys and an optional endpoint URL |
| Bridge | On the Connection, to reach a queue endpoint in a private network, such as a self-hosted SQS-compatible service |
| Custom domain | Not supported |
| Linked agents | One or more. A message starts every linked agent. |
| While paused | Inbound: connic stops polling. Messages stay in the queue and are processed after resume. Messages whose runs were still in progress become visible again after the visibility timeout and start new runs. Outbound: nothing is sent. |
| New connectors | Inbound connectors are created paused in the dashboard, and through the REST API or connic MCP unless the request sets enabled: true. Start them with Resume. Connectors in code start active. |
Set up
In AWS, create a standard or FIFO queue, or use an existing one. For inbound, give it a dead-letter queue if a message that keeps failing should stop being retried after a number of receives.
Create an IAM user with the permissions under IAM permissions and an access key for it.
Open the agent. In Connector Flow, click Add inbound connector for inbound or Add outbound connector for outbound. Then click Create New Connector and select AWS SQS.
Choose Inbound (Consumer) or Outbound (Producer). Under Connection, pick a saved Connection or create one with the AWS Access Key ID and AWS Secret Access Key. For a custom endpoint, such as a VPC endpoint or a self-hosted SQS-compatible service, also set the Endpoint URL in the Connection, and select a Bridge there if the endpoint is in a private network; see Connection.
Enter the Queue URL. Under Advanced Settings, adjust the polling settings for inbound, or set Message Group ID (FIFO only) for an outbound FIFO queue.
Click Create. A new inbound connector is paused: click Resume in its details drawer to start polling. To reopen the drawer, hover over the connector in the flow and click the eye icon.
In code
Declare the connector in connectors/*.yaml. The file names the Connection and never contains AWS keys. Connectors in code start active, so an inbound connector starts polling when its first deploy goes live.
type: sqs
mode: inbound
connection: aws-orders # Connection with the access keys
config:
queue_url: https://sqs.eu-central-1.amazonaws.com/123456789012/orders
visibility_timeout: 600
agents:
- order-processortype: sqs
mode: outbound
connection: aws-orders
config:
queue_url: https://sqs.eu-central-1.amazonaws.com/123456789012/order-results.fifo
message_group_id: orders
agents:
- name: order-processor
outbound: { usage: automatic }Configuration
The fields of an SQS connector, the same in connectors/*.yaml, the REST API, and connic MCP. The descriptions name the matching setting in the dashboard. Connectors in code describes the fields every connector shares, such as agents and environments.
| Field | Type | Status | Description |
|---|---|---|---|
| type | string | Required | sqs. |
| mode | string | Required | inbound or outbound. Dashboard: Mode. |
| connection | string | Required | Name or ID of a Connection of type sqs, which holds the access keys, the optional endpoint URL, and the Bridge. See Connection. Dashboard: Connection. |
| config | object | Required | SQS settings. |
| queue_url | string | Required | Inbound and outbound. The full queue URL, such as https://sqs.eu-central-1.amazonaws.com/123456789012/orders, without credentials, query, or fragment. When the Connection has no endpoint URL, it must be an AWS SQS queue URL, and connic sends requests to its host. With an endpoint URL, any http:// or https:// URL with a queue path works, and requests go to the endpoint URL. A URL ending in .fifo is a FIFO queue. Dashboard: Queue URL. |
| max_messages | integer | Optional | Inbound. Messages per receive request, from 1 to 10. Dashboard: Max Messages per Poll.Default: 10 |
| wait_time_seconds | integer | Optional | Inbound. Seconds a receive request waits for messages (long polling), from 0 to 20. A request returns as soon as a message is available. 0 turns long polling off and sends many more empty requests to SQS. Dashboard: Wait Time (seconds).Default: 20 |
| visibility_timeout | integer | Optional | Inbound. Seconds a received message stays hidden from other consumers, from 6 to 43,200. connic extends it while the message's runs are in progress, so it mainly sets how soon a message reappears after a failure. Dashboard: Visibility Timeout (seconds).Default: 300 |
| message_group_id | string | Optional | Outbound. Message group for a FIFO queue. connic uses default when it's empty and ignores it for standard queues. Dashboard: Message Group ID (FIFO only). |
The numeric fields take integers only.
Connection
A Connection of type sqs holds these fields. Every SQS connector in the project can use it, and a connector's config doesn't take them. Manage Connections in Project Settings → Connections or through the REST API.
| Field | Type | Status | Description |
|---|---|---|---|
| aws_access_key_id | string | Required | Access key ID of the IAM user. Dashboard: AWS Access Key ID. |
| aws_secret_access_key | string | Required | Secret access key of the IAM user. Secret. Dashboard: AWS Secret Access Key. |
| endpoint_url | string | Optional | Origin of a custom SQS endpoint, such as a VPC endpoint, ElasticMQ, or LocalStack: scheme, host, and optional port, without credentials, path, query, or fragment. connic then sends every SQS request there instead of to the queue URL's host. Without a Bridge, it must be a public HTTPS URL, on any port. With one, it can be a private http:// or https:// address; for https://, the endpoint needs a certificate from a public certificate authority that's valid for its hostname. Dashboard: Endpoint URL (Optional). |
| bridge | string | Optional | Name or ID of the Bridge that reaches the queue endpoint in a private network. The REST API and connic MCP take it as the Connection's top-level bridge, not in config. Dashboard: Bridge. |
The Connection has no region. connic reads it from the host of the endpoint URL or the queue URL, such as eu-central-1 from sqs.eu-central-1.amazonaws.com, and signs requests for us-east-1 when the host names none, as with ElasticMQ or LocalStack.
Every connector that uses the Connection goes through its endpoint URL and Bridge. To use a different Bridge per environment, give each environment its own Connection; see Connections and Bridges. When you change the access key ID, the endpoint URL, or the Bridge of a saved Connection, enter the secret access key again; connic refuses the change otherwise.
Agent input
Modes: Inbound
Each message becomes the input of every linked agent. A JSON object body keeps its fields, and connic adds the message metadata under _sqs:
{
"order_id": "12345",
"customer_email": "john@example.com",
"items": ["widget-a", "widget-b"],
"total": 234.56,
"_sqs": {
"message_id": "7b9b3f4e-2c1d-4f5a-9e8b-1a2b3c4d5e6f",
"receipt_handle": "AQEBw...",
"queue_url": "https://sqs.eu-central-1.amazonaws.com/123456789012/orders",
"approximate_receive_count": 1,
"sent_timestamp": 1768473000000
}
}_sqs holds the message_id, the receipt_handle, the queue_url, the approximate_receive_count, which counts how often SQS has delivered the message, and the sent_timestamp in milliseconds since the Unix epoch.
Any other body is wrapped under message: other JSON values as parsed, and text that isn't JSON as a string. Message attributes are not passed to the agent.
A JSON object can carry files in a files array. Each file has a name, a mime_type, and base64-encoded data. connic accepts up to 50 complete files, at most 32 MiB combined. Invalid files are omitted one by one. At the first file over a limit, connic keeps the files before it and accepts no further files. Each omitted file is described in file_issues, and the run continues without it.
Files are optional by default. Turn on Files required for an agent in the connector's details drawer, or set files_required: true on its link in YAML, to fail the run before it starts when a file is missing or was omitted.
Message lifecycle
Modes: Inbound
connic long-polls the queue and receives up to max_messages messages per request. Each message starts a run for every linked agent. While those runs are queued or running, connic keeps the message hidden by extending its visibility timeout every half timeout.
When all runs of a message complete, connic deletes it from the queue. When a run fails or is cancelled, connic stops extending: the message becomes visible after the visibility timeout, is received again, and starts new runs for every linked agent, including agents whose run had completed. A dead-letter queue in AWS ends this after the number of receives you set; _sqs.approximate_receive_count shows the count so far.
connic watches a message's runs for up to 30 minutes. If they haven't all completed by then, it stops extending, and the message is received again while the earlier runs continue. Messages in progress when the connector is paused, updated, or restarted are also received again after the visibility timeout.
_sqs.message_id, which stays the same across receives.IAM permissions
The IAM user of the Connection needs these permissions on the queue. Inbound connectors receive messages, extend their visibility, and delete them:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"sqs:ReceiveMessage",
"sqs:DeleteMessage",
"sqs:ChangeMessageVisibility"
],
"Resource": "arn:aws:sqs:eu-central-1:123456789012:orders"
}
]
}Outbound connectors send messages:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "sqs:SendMessage",
"Resource": "arn:aws:sqs:eu-central-1:123456789012:order-results.fifo"
}
]
}Outbound delivery
Modes: Outbound
An outbound SQS connector sends JSON messages to its queue. It sends when a linked agent's run completes, when the model calls it as a tool, or when middleware calls it, depending on the link's usage.
Automatic payload
An automatic link sends the completed run as the message body. Automatic sources describes which runs send.
{
"run_id": "550e8400-e29b-41d4-a716-446655440000",
"agent_name": "order-processor",
"status": "completed",
"output": "Order processed successfully. Total: $234.56",
"error": null,
"started_at": "2026-01-15T10:30:00Z",
"ended_at": "2026-01-15T10:30:05Z",
"token_usage": {
"input_tokens": 150,
"output_tokens": 50,
"thinking_tokens": 0,
"cached_input_tokens": 0,
"total_tokens": 200
}
}Agent-tool and middleware payload
The model or middleware passes the message body under payload. connic sends the value of payload and adds the queue, credentials, FIFO message group, serialization, retries, and Bridge routing, none of which the model sees.
{
"payload": {
"order_id": "12345",
"status": "approved"
}
}FIFO queues
For a queue URL ending in .fifo, connic sends every message with message_group_id as its message group, or default when that's empty. SQS delivers the messages of one group in order. The deduplication ID is the run ID for automatic sends. For agent-tool and middleware sends, it's the payload's run_id field if it has one, otherwise a new ID for each send.
Delivery and retries
The message body is the JSON payload, without message attributes. A failed send is tried 3 times in total, waiting 1 and then 2 seconds between attempts. The connector's runs show each delivery and its error.
Limits and errors
| Situation | What happens |
|---|---|
| No agent is linked | connic deletes each message without starting a run and records it as a connector run with No agents linked. |
| A run fails or is cancelled | The message stays in the queue and is received again after the visibility timeout. See Message lifecycle. |
| Runs take longer than 30 minutes | connic stops keeping the message hidden. It is received again and starts new runs while the earlier ones continue. |
| Starting a run fails | connic records a failed connector run. The message is received again after the visibility timeout and starts runs for every linked agent. |
| A receive request fails | connic writes the error to the connector logs and polls again with exponential backoff, from 5 seconds up to 2 minutes. This includes rejected keys and missing permissions. |
| Sending fails (outbound) | connic makes up to 3 attempts, then marks the delivery as failed. See Delivery and retries. |