Skip to main content
Connic
Back to BlogIndustry Insights

Connector Patterns for AI Agents: Webhook vs Kafka vs Postgres vs SQS

Webhook, Kafka, Postgres LISTEN/NOTIFY, and SQS each trigger an AI agent differently. Compare their delivery guarantees, ordering, and durability to pick one.

June 29, 2026(last updated: June 30, 2026)9 min read

An AI agent in production does not wait behind a chat box. It wakes up when something happens elsewhere: a service calls it, a database row changes, or a message lands on a stream or a queue. In Connic that wake-up is an inbound connector. The four most common ones, webhook, Apache Kafka, Postgres LISTEN/NOTIFY, and AWS SQS, each deliver the same event with sharply different guarantees. Pick the wrong one and you either drop events under load or stand up infrastructure you never needed.

Every trigger is an inbound connector

All four are inbound connectors: an external event arrives, Connic parses it, and an agent run starts with the payload attached. The connector layer handles receiving the event, authenticating the source, and retrying or buffering wherever the protocol allows. So the real difference between them is not the agent. It is what happens to an event on its way from your system to that run. See the connectors overview for how inbound, outbound, and sync modes fit together, and why pre-built connectors replace integration glue for the broader case.

Webhook: synchronous HTTP push

A webhook connector gives your agent a URL. Any service that can make an HTTP request triggers a run by posting to it, authenticated with a shared secret in the X-Connic-Secret header. It is the lowest-latency option and the only one that can hand the result straight back: in sync mode the request blocks until the run finishes and returns its output, which is what a chat UI or a synchronous API call needs.

terminal
curl -X POST "<webhook-url>" \
  -H "X-Connic-Secret: <your-secret-key>" \
  -H "Content-Type: application/json" \
  -d '{"order_id": "12345", "action": "review"}'

The trade-off is durability. An HTTP request is a single attempt. If your agent is briefly unavailable, the event is gone unless the caller retries it. There is no buffer and no ordering between concurrent calls, so a webhook fits when the sender owns delivery and fails when events must never be lost. See the webhook connector reference for sync mode and signature verification.

Apache Kafka: streaming consumer

A Kafka connector subscribes to a topic as a consumer and starts a run for every message. The full Kafka context (topic, partition, offset, key) arrives under a _kafka field. Because Kafka is a durable, ordered log, this pattern gives the strongest guarantees of the four: at-least-once delivery, ordering within a partition, and replay of history by resetting the consumer to the earliest offset. Consumer groups let you share load across runs or fan the same stream out to several agents.

message-payload.json
{
  "order_id": "12345",
  "customer": "john@example.com",
  "items": ["widget-a", "widget-b"],
  "_kafka": {
    "topic": "orders",
    "partition": 0,
    "offset": 1542,
    "key": "order-12345"
  }
}

Reach for Kafka when you already run it, when throughput is high, or when ordering and replay matter, such as reprocessing a day of events after fixing an agent. The cost is operational: you need a cluster, and the connector is a consumer in it. Full options are in the Kafka connector reference.

Postgres LISTEN/NOTIFY: in-database push

If the event you care about is a change in your database, you may not need a queue at all. The Postgres connector opens a persistent connection and listens on a channel; a trigger calls pg_notify when rows change, and each notification starts a run. There is no polling and no extra infrastructure: the database you already have becomes the event source.

trigger.sql
-- Notify the agent whenever a customer row is inserted
CREATE OR REPLACE FUNCTION notify_new_customer()
RETURNS TRIGGER AS $$
BEGIN
  PERFORM pg_notify(
    'new_customers',
    json_build_object('customer_id', NEW.id)::text
  );
  RETURN NEW;
END;
$$ LANGUAGE plpgsql;

CREATE TRIGGER customer_insert_trigger
  AFTER INSERT ON customers
  FOR EACH ROW
  EXECUTE FUNCTION notify_new_customer();

NOTIFY is fire-and-forget, though. Notifications are not buffered: if nothing is listening at that moment they are dropped, and there is no replay. Payloads are capped at 8000 bytes, so the durable pattern is to send IDs and let the agent fetch the full row. Use LISTEN/NOTIFY for near-real-time reactions to data changes where an occasional miss during a reconnect is acceptable, and use Kafka or SQS when every change must be processed. If the database sits in a private network, route it through a private network bridge rather than exposing it. The full setup is in the Postgres connector reference.

AWS SQS: durable polled queue

An SQS connector polls a queue with long polling and starts a run per message. It sits between durability and simplicity: messages persist in the queue until a run completes and deletes them, so a restart or a spike never loses work. If a run fails, the message reappears after its visibility timeout and is retried; messages that fail repeatedly can be routed to a dead-letter queue you configure in AWS. Standard queues do not guarantee order, while FIFO queues preserve it within a message group.

This is the pattern for reliable asynchronous work that must survive failure without you building the retry machinery yourself. The latency floor is the polling interval, up to 20 seconds, and you need an AWS account and credentials. See the SQS connector reference for the queue and polling settings.

Side by side

The four patterns line up cleanly on the dimensions that decide which one fits:

DimensionWebhookKafkaPostgresSQS
Trigger styleSynchronous HTTP pushStreaming consumerIn-database push (NOTIFY)Polled queue
Delivery guaranteeAt-most-once (caller retries)At-least-onceAt-most-onceAt-least-once
OrderingNonePer partitionCommit order while connectedNone (FIFO: per group)
Buffering / replayNoneDurable log, replayableNone (not buffered)Durable queue, no replay
BackpressureHits the agent directlyConsumer lagNoneQueue absorbs spikes
Typical latencyLowest (can return result)Near-real-timeNear-real-timePoll interval (up to 20s)
Extra infrastructureNoneKafka clusterReuse your databaseAWS account + queue

Choosing a pattern

Reach for a webhook
Another service can call your agent over HTTP and you want the lowest latency, optionally getting the result back in the same request. You accept that delivery is the caller's responsibility.
Reach for Kafka
You already run Kafka, throughput is high, or you need ordering within a partition and the ability to replay history. You can operate a cluster and a consumer.
Reach for Postgres LISTEN/NOTIFY
The event is a row change, you want zero new infrastructure, and an occasional miss during a reconnect is acceptable. Send IDs, not whole rows.
Reach for SQS
Work is asynchronous and must survive failure: durable buffering, automatic retry after the visibility timeout, and a dead-letter queue, without building any of it yourself.
Trigger your agent from anything

Webhooks, Kafka, Postgres, SQS, and more, wired up as configuration instead of consumer code.

Try Connic free

The same patterns cover the rest of the catalog

These four are the archetypes, but the model is the same for the other systems Connic connects to: cron for scheduled runs, S3 for file uploads, email, Stripe for signed events, Telegram for chat, WebSocket for live streams, and an MCP connector that exposes agents as callable tools, among others. Each one is push or pull, durable or ephemeral, ordered or not, so the decision dimensions above carry straight over. See the full list on the connectors page.

Triggering in production vs. testing

These connectors are the production path for triggering agents from real events. A REST trigger endpoint exists as well, but it is meant for first-party calls and testing. Reach for a connector whenever an external system should drive the agent. See the REST API reference for the endpoint and the quickstart to wire up your first connector.

Frequently Asked Questions

How do I trigger an AI agent from a database?

Use the Postgres LISTEN/NOTIFY connector. Add a trigger that calls pg_notify on the channel the connector listens to, and each row change starts an agent run with the payload attached. It needs no polling or extra infrastructure, but NOTIFY is not buffered, so use Kafka or SQS instead when every change must be processed.

Which connector should I use for high-throughput event streams?

Kafka. As a durable, ordered log it gives at-least-once delivery, ordering within a partition, replay from any offset, and load sharing across consumer groups. It is the right choice when volume is high or you need to reprocess history; the trade-off is running a Kafka cluster.

What is the difference between a webhook and a queue trigger for an agent?

A webhook is a synchronous HTTP push: lowest latency, can return the run result, but a single delivery attempt with no buffering. A queue like SQS is durable and buffered: messages persist until processed, failed runs retry after the visibility timeout, and spikes are absorbed, at the cost of polling latency.

Can I replay past events to an AI agent?

With Kafka, yes: reset the consumer to an earlier offset and the connector reprocesses the log. SQS retries a failed message until it succeeds or moves to a dead-letter queue, but deleted messages are gone. Webhook and Postgres LISTEN/NOTIFY have no replay; the event is processed once or not at all.

Do Connic connectors guarantee exactly-once delivery?

No. Kafka and SQS are at-least-once, so an agent can occasionally see a duplicate; use the Kafka key or a message ID to deduplicate. Webhook and Postgres LISTEN/NOTIFY are at-most-once unless the sender retries. Make agent logic idempotent for events that must not be double-processed.

More from the Blog

Industry Insights

What Is an MCP Connector? A Practical Definition

An MCP connector links an AI app to external tools and data over the Model Context Protocol. Learn how it works and when it beats a custom API integration.

July 8, 20268 min read
Industry Insights

AI Agent Platforms With EU Data Residency: 2026 Shortlist

Which AI agent platforms keep data in the EU? The 2026 shortlist grouped by residency model, and what residency must cover: traces, storage, model calls.

July 6, 202612 min read
Industry Insights

State of AI Agents in DACH 2026

How DACH teams build, trigger, and run production AI agents in 2026 — adoption, model mix, connectors, cost, reliability, and compliance, from Connic customer data.

June 27, 202612 min read
Industry Insights

Pre-built Connectors for AI Agents: Skip the Integration Glue

Production agents have to receive events from and send results to the systems around them. Pre-built connectors turn that plumbing into a platform feature instead of custom code you write and maintain.

June 16, 20268 min read
Industry Insights

The Real Cost of Assembling Your Own AI Agent Stack

The real cost of assembling your own AI agent stack isn't the tools — it's the integration and maintenance tax between them, and when buying a platform wins.

June 9, 202610 min read
Industry Insights

How to Run AI Agents in the EU Without US Hyperscalers

Run production AI agents in the EU without US hyperscalers: what EU-hosted must really mean, where the US CLOUD Act exposes you, and a sovereignty checklist.

June 4, 20269 min read
Industry Insights

Best AI Agent Platforms for EU Enterprises in 2026

Ranked shortlist of AI agent platforms evaluated on EU data residency, self-hosting, MCP tool support, BYOK, EU AI Act readiness, and SLA terms. Updated July 2026.

May 19, 202616 min read
Industry Insights

AI Agent Deployment Platforms in 2026: 4 Types Compared

Agent-native runtimes, workflow engines, framework stacks, or plain frameworks? Compare the 4 platform types on lock-in, pricing, and connectors.

April 19, 202612 min read
Industry Insights

The EU AI Act Is Here. Your AI Agents Need to Comply.

The EU AI Act is the world's first comprehensive AI regulation, and it applies to your AI agents today. Here's what it requires, what the penalties look like, and how Connic makes compliance the default rather than an afterthought.

April 13, 202611 min read