AI agent routing is the integration layer that moves an external event into an agent and delivers the result to the system that needs it. Our platform handles that round trip with inbound connectors, synchronous routes, and outbound connectors, so the agent can sit between the business systems already in use.
What is AI agent routing?
AI agent routing connects an event source, an agent run, and a result destination. It answers practical questions: Which event starts the agent? Does the caller wait? Where does the finished result go? Which component owns credentials, payload formatting, and retries?
This article uses routing to mean traffic across system boundaries. Choosing a model, delegating a task to another agent, or building a fixed multi-agent sequence belongs to agent orchestration. The documentation covers agent calls through orchestration tools for that routing problem.
| Stage | Routing question | Connic path |
|---|---|---|
| Event arrives | Which external system starts the work? | Inbound or sync connector |
| Agent starts | Which linked agent or agents receive the event? | Connector Flow links |
| Run completes | Does the caller wait for the answer? | Sync response or asynchronous run |
| Result leaves | Which system receives the output, and when? | Automatic, agent-tool, or middleware outbound connector |
Why triggering an AI agent is only half the integration
A webhook handler or queue consumer can start an agent. The work is still incomplete if the fraud score never reaches the alert topic, the classified ticket never returns to the support system, or the drafted reply never reaches the customer. Every asynchronous run needs a result destination.
An inbound acknowledgement is different from a result. Webhook and inbound MCP requests return after dispatch with identifiers for the created runs. That keeps the source request short, but the caller does not receive the completed output in that response. Use a sync connector when the caller should wait, or attach an outbound connector that delivers the result later.
Trigger selection has its own delivery and replay tradeoffs. The webhook, Kafka, SQS, and Postgres trigger patterns comparison explains those tradeoffs for the ingress side of the route.
How our platform routes inputs and results
Connector direction defines what happens at the system boundary. One configured connector instance has one direction, so a Kafka round trip uses an inbound consumer and an outbound producer. The input and output transports can also differ: a Stripe event can start a run whose result goes to SQS or an HTTP callback.
A sync webhook fits an interactive product feature that needs the answer immediately. An inbound webhook plus an outbound callback fits longer work. Kafka, SQS, email, and Telegram use separate inbound and outbound connector instances. connector directions and setup.
How do Connic outbound connector modes differ?
Direction tells Connic that a connector sends data out. Its link mode decides who controls each send. This choice belongs to the link between an outbound connector and an agent, so the same connector type can support different routing policies in different flows.
| Outbound mode | Who decides | When it sends | Best fit |
|---|---|---|---|
| Automatic | Connector Flow policy | After each eligible run completes | Result delivery for all runs or selected inputs |
| Agent-tool | The LLM agent | When the model calls the connector tool | Content-dependent routing that needs model judgment |
| Middleware | Application Python code | When middleware calls the connector | Deterministic business rules outside the model |
Automatic outbound connectors
Use automatic mode when each eligible completed run should queue a delivery. It can cover all runs, including manual, scheduled, and agent-triggered runs, or only runs started by selected inbound or sync connectors. Failed and cancelled runs are skipped.
The outgoing format depends on the transport. Webhook, Kafka, and SQS automatic connectors deliver a completed-run envelope. Email and Telegram connectors interpret the final output as a message for that channel. The connector holds those transport-specific rules. The agent prompt can stay focused on the job.
Agent-tool outbound connectors
Agent-tool mode adds a named connector tool to an LLM agent. The model chooses whether to call it, when to call it, and which valid payload to supply. Use it when the decision depends on meaning inside the conversation or event, such as escalating only the cases the agent classifies as urgent.
The connector validates the tool payload and keeps its stored URL, credentials, and routing defaults unavailable to the model. The agent receives a purpose-specific action. Connic builds the transport request and handles the secrets.
Middleware outbound connectors
Middleware mode keeps the routing decision in Python. Code can call the connector before or after agent execution with send_connector(action_name, payload). The model cannot access a middleware outbound connector. Use middleware for fixed policy checks, deterministic fan-out, or explicit per-run duplicate suppression with an idempotency key.
from connic.tools import send_connector
async def after(response: str, context: dict) -> str:
if context["payload"].get("priority") == "urgent":
await send_connector(
"send_to_results_webhook",
{
"payload": {
"run_id": context["run_id"],
"result": response,
}
},
idempotency_key=context["run_id"],
)
return responseThis example routes urgent results to a configured HTTP webhook and uses the run ID as the idempotency key. Connic resolves the connector and queues the delivery. Follow the middleware outbound connector guide for the runtime contract.
Which result path fits each AI agent workflow?
A browser waiting on an HTTP response and a Kafka consumer expect different result paths. Connic keeps the agent logic unchanged while the connector layer handles each transport.
| Workflow | Input route | Result route |
|---|---|---|
| Interactive HTTP request | Webhook in sync mode | Same HTTP response |
| Long-running HTTP job | Inbound webhook | Outbound webhook callback |
| Event or queue pipeline | Kafka or SQS inbound connector | Separate Kafka or SQS outbound connector |
| Inbox or chat workflow | Email or Telegram inbound connector | Separate channel outbound connector |
| MCP client | MCP in sync or inbound mode | Tool result or immediate run ID |
| Private destination | Any supported source | Bridge-routed outbound HTTP, Kafka, SQS, or email |
One agent can have several outbound links, and automatic links can fan a completed result out to several destinations. Automatic source filters keep each route narrow. One outbound callback can accept only runs from the production webhook while an all-runs link also covers manual, scheduled, and agent-triggered work.
The current Connic connector catalog lists supported directions and configuration for each transport.
What Connic removes from application routing code
Without a connector layer, the application owns the endpoints and consumers that accept work, plus the callback workers that return it. It also stores destination credentials, validates payloads, tracks retry state, and writes delivery logs. Connic keeps that work with the environment-scoped connector. The agent remains YAML, Python, and Git; Connector Flow controls how external systems reach it and where its output goes.
Private infrastructure does not require a public inbound port. Bridge runs inside the private network and establishes an outbound-only tunnel that supported connectors can use for bidirectional traffic. private system access with Connic Bridge.
Managed connectors link the systems that start agents to the result path and handle credentials, payload validation, and delivery.
Start routing agents free