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
| Field | What it controls | Required | Notes |
|---|---|---|---|
| Client | Database type (mysql, postgres, sqlite, …). | required | |
| Host | Server address. | required | |
| User | Database user. | required | |
| Password | Database password. | required | Stored as a secured value. |
| Database | Database name. | required | |
| Query | SELECT statement to poll. | required | Should return only the rows you want to react to. |
| Poll interval | How often to run the query, in milliseconds. | optional | Default is 60 000 (once per minute). |
| Output name (memory output) | Where the new rows are stored. | required | The 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
- To act on the database from inside the workflow: Database Query.
- For other event sources: HTTP Webhook, Filesystem Watcher.