Skip to main content

Database Listener

Run an automation when a SQL query returns new rows.

What it does

Polls a database with a SELECT statement at a fixed interval. When the query returns rows the listener has not seen before, the workflow fires — once per new row. This is the simplest way to react to changes in any database table you can read.

What you configure

FieldWhat it controlsRequiredNotes
ClientDatabase type (mysql, postgres, sqlite, …).required
HostServer address.required
UserDatabase user.required
PasswordDatabase password.requiredStored as a secured value.
DatabaseDatabase name.required
QuerySELECT statement to poll.requiredShould return only the rows you want to react to.
Poll intervalHow often to run the query, in milliseconds.optionalDefault is 60 000 (once per minute).
Output name (memory output)Where the new rows are stored.requiredThe value is an array.

📷 SCREENSHOT: The Database Listener configuration with the query field and the poll-interval slider visible.

Example scenario

React to new orders. Watch the orders table with SELECT id, customer, total FROM orders WHERE status = 'new' AND created_at > NOW() - INTERVAL 5 MINUTE. For each new order, an LLM Prompt step drafts a personalized confirmation; a Send E-Mail step delivers it.

Recommendations

  • ✅ Include a time filter in the query so it returns a small, fresh window. Otherwise the listener has to remember which rows it has already seen across an ever-growing table.
  • ✅ Use a dedicated read-only user for this connection.
  • ✅ Start with a longer poll interval (e.g. 5 minutes) and shorten only if you actually need faster reaction time.
  • ⚠️ The listener tracks "seen" rows in memory. If the AI Kit restarts, it will not re-process rows it has already triggered on — make sure the query is robust against this.
  • ❌ Do not point the listener at a high-volume transactional table without a time filter. You will hammer the database.

What to do next