RabbitMQ
Start agents from messages in a RabbitMQ queue, or publish run results to an exchange.
On this page
| Modes | Inbound, outbound |
| YAML type | rabbitmq |
| Credentials | A Connection of type rabbitmq with the host, virtual host, user, and TLS settings |
| Bridge | On the Connection, to reach a broker in a private network |
| Custom domain | Not supported |
| Linked agents | One or more. A message starts every linked agent. |
| While paused | Inbound: connic stops consuming, and messages stay in the queue until you resume. Outbound: nothing is published. |
| 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
Create the queue for inbound, or the exchange and its bindings for outbound. connic doesn't declare queues or exchanges. Give the RabbitMQ user read permission on the queue or write permission on the exchange in its virtual host.
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 RabbitMQ.
Choose Inbound (Consumer) or Outbound (Publisher). Under Connection, pick a saved Connection or create one with the host, user, and TLS settings; see Connection. If the broker is in a private network, select the Bridge in the Connection.
For inbound, enter the Queue and optionally the Prefetch. For outbound, enter the Exchange and the Routing Key.
Click Create. A new inbound connector is paused: click Resume in its details drawer to start consuming. 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 broker credentials. Connectors in code start active, so an inbound connector starts consuming when its first deploy goes live.
type: rabbitmq
mode: inbound
connection: orders-rabbitmq # Connection with the host, credentials, TLS, and optional Bridge
config:
queue: orders
prefetch: 10
agents:
- order-processortype: rabbitmq
mode: outbound
connection: orders-rabbitmq
config:
exchange: order-results
routing_key: orders.processed
agents:
- name: order-processor
outbound: { usage: automatic }Configuration
The fields of a RabbitMQ 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 | rabbitmq. |
| mode | string | Required | inbound or outbound. Dashboard: Mode. |
| connection | string | Required | Name or ID of a Connection of type rabbitmq, which holds the host, the credentials, TLS, and the Bridge. See Connection. Dashboard: Connection. |
| config | object | Required | RabbitMQ settings. |
| queue | string | Required | Inbound. The queue to consume. It must already exist. Dashboard: Queue. |
| prefetch | integer | Optional | Inbound. How many unacknowledged messages RabbitMQ sends ahead, from 1 to 1000. Dashboard: Prefetch.Default: 10 |
| exchange | string | Optional | Outbound. The exchange to publish to. It must already exist. Leave it empty for the default exchange, which delivers to the queue named by the routing key. Dashboard: Exchange. |
| routing_key | string | Optional | Outbound. The routing key of every published message. Required with the default exchange. Dashboard: Routing Key. |
Connection
A Connection of type rabbitmq holds these fields. Every RabbitMQ 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 |
|---|---|---|---|
| host | string | Required | Hostname or IP address of the broker. Without a Bridge, it must resolve only to public IP addresses. Dashboard: Host. |
| port | integer | Optional | AMQP port. Without one, connic uses 5671 with TLS and 5672 without. Dashboard: Port. |
| vhost | string | Optional | The virtual host that holds the queue or exchange. Dashboard: Virtual Host.Default: / |
| username | string | Required | The RabbitMQ user. Dashboard: Username. |
| password | string | Required | The user's password. Secret. Dashboard: Password. |
| use_tls | boolean | Optional | Connect over TLS and check the broker's certificate and hostname. Dashboard: Use TLS.Default: true |
| ssl_ca_pem | string | Optional | With TLS. CA certificate in PEM format for a broker whose certificate isn't from a public CA. Paste the contents, not a file path. Secret. Dashboard: SSL CA Certificate PEM. |
| bridge | string | Optional | Name or ID of the Bridge that reaches a broker in a private network. TLS still checks the certificate against the host. The REST API and connic MCP take it as the Connection's top-level bridge, not in config. Dashboard: Bridge. |
Every connector that uses the Connection goes through its Bridge. To use a different Bridge per environment, give each environment its own Connection; see Connections and Bridges. When you change the host, port, virtual host, user, TLS, or Bridge of a saved Connection, enter the password again; when you change the host, port, TLS, or Bridge, enter the CA certificate again too. connic refuses the change otherwise.
Agent input
Modes: Inbound
Each message becomes the input of every linked agent. A JSON object keeps its fields, and connic adds the message properties under _rabbitmq:
{
"order_id": "12345",
"customer": "john@example.com",
"_rabbitmq": {
"queue": "orders",
"exchange": "orders",
"routing_key": "orders.created",
"message_id": "order-12345-created",
"correlation_id": null,
"content_type": "application/json",
"headers": { "tenant": "acme" },
"timestamp": "2026-01-15T10:30:00+00:00",
"redelivered": false
}
}_rabbitmq holds the queue, the exchange and routing_key the message was published with, the message_id, correlation_id, content_type, and headers properties, the timestamp property as an ISO 8601 time, and redelivered, which is true when RabbitMQ delivered the message before. Properties the publisher didn't set are null. Header values that are bytes arrive as text.
Any other body is wrapped under message: other JSON values as parsed, text that isn't JSON as a string, and an empty body as null.
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.
Queues and prefetch
Modes: Inbound
Each inbound connector consumes one queue. Connectors on the same queue share its messages: RabbitMQ delivers each message to one of them. To start agents from several queues, create one inbound connector per queue and link them to the same agent; _rabbitmq.queue tells the events apart.
RabbitMQ sends up to prefetch messages ahead, and connic handles them one after another in the order they arrive. A higher prefetch saves round trips on a busy queue; a lower one leaves more messages to other consumers of the queue.
Deleting a connector doesn't delete its queue or the messages in it.
Delivery and ordering
Modes: Inbound
connic acknowledges a message once it has stored a queued run for every linked agent, before those runs execute. Stored runs survive worker restarts and deployments. Since connic doesn't hold a message until its runs finish, long runs never reach RabbitMQ's consumer timeout.
A message that RabbitMQ delivers again, after a partial failure or a restart before it was acknowledged, reuses the run already stored for it. connic identifies a message by its message_id property within the queue and virtual host. Without one, it uses the body and headers, so identical messages without a message_id start one run per agent. Set a unique message_id when you publish to make every message count.
A message comes back to the queue only when connic couldn't store its runs. On a quorum queue each return counts as a delivery, and RabbitMQ dead-letters the message after 20 deliveries by default, or drops it if the queue has no dead-letter exchange. Set the queue's delivery-limit and a dead-letter exchange to keep such messages.
A run that fails after it was stored causes no redelivery and no dead-letter message. The failed run keeps its full input, so you can rerun it. Retries inside a run follow the agent's retry_options.
Runs are stored in queue order but execute in parallel up to max_concurrent_runs. For ordering by a field, such as an order ID, add a concurrency rule on it:
concurrency:
key: order_id
on_conflict: queueRuns with the same value then start one at a time in arrival order, while different values still run in parallel. A failed run releases its value, so the next message with it still runs.
Outbound delivery
Modes: Outbound
An outbound RabbitMQ connector publishes JSON messages to its exchange with its routing key. It publishes 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 publishes the completed run as the message body:
{
"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
}
}To build a pipeline, link an inbound RabbitMQ connector and an automatic outbound RabbitMQ connector to the same agent; the agent's output arrives in output. Automatic sources describes which runs publish. A run that middleware ends with StopProcessing counts as completed and publishes the StopProcessing response as its output, unless it is raised with publish_outbound=False. That flag doesn't undo an agent-tool or middleware call made earlier in the run.
Agent-tool and middleware payload
The model or middleware passes the message body under payload. connic publishes the value of payload and adds the exchange, routing key, credentials, serialization, retries, and Bridge routing, none of which the model sees.
{
"payload": {
"order_id": "12345",
"status": "approved"
}
}Delivery and retries
Each message has a JSON body, the content type application/json, and persistent delivery mode, so a durable queue keeps it across broker restarts. Its message_id is the run ID. For a tool or middleware call, it is the payload's run_id field if it has one, otherwise an ID that stays the same across the delivery's retries. Consumers can use it to drop duplicates.
connic publishes with publisher confirms and waits up to 30 seconds for the broker to confirm. A message that no queue takes comes back as an error instead of disappearing. Connection errors and unconfirmed messages are 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 |
|---|---|
| A message body isn't valid UTF-8 | connic rejects the message without requeueing it and records a failed connector run. RabbitMQ dead-letters the message if the queue has a dead-letter exchange, and drops it otherwise. |
| Storing a run fails | connic closes the connection, so RabbitMQ returns the message and the other unacknowledged ones to the queue. The consumer reconnects after a short delay and receives them again. |
| A message keeps coming back | Each return counts as a delivery. Quorum queues dead-letter or drop a message after 20 deliveries by default; classic queues have no such limit. |
| No agent is linked | connic acknowledges each message without starting a run and records it as a connector run with No agents linked. |
| The queue doesn't exist, or a broker or network error | The consumer reconnects with exponential backoff, from 5 seconds up to 2 minutes. |
| Login or permissions are refused | The consumer stops and writes the error to the connector logs. It starts again when you update the connector or its Connection, or pause and resume it. |
| Publishing fails (outbound) | Connection errors and messages the broker doesn't confirm get up to 3 attempts. A refused login, a missing exchange, or a message no queue takes fails at once. See Delivery and retries. |