Blog
Why AI Agents Need Listeners, Not Cron Jobs
Guide
ยท
Quick answer: A cron job wakes your AI agent on a timer and asks โanything new?โ. A listener wakes it the moment something actually happens: a row is inserted, a payment fails, an email arrives. Listeners make agents faster (seconds instead of up to an hour), cheaper (no empty runs) and more accurate (they see each change, not just whatever the table looks like at the next poll). In BuildShip, listeners are triggers: Supabase and MongoDB database triggers, Firestore document triggers, webhooks, email, Stripe and more, with schedules still there for work that really is time-based.

Most AI agents in production today run on an alarm clock.
Every hour a cron job fires, the agent wakes up, pulls a batch of data, looks around and goes back to sleep. Usually there was nothing to do. You paid for the wake-up anyway, and anything that happened at 10:01 waited until 11:00.
John Suh put this well in his essay โAgent platform of 2027โ. In the section on listeners and monitors, he argues that agents should be able to define streams of events from the outside world, per tenant, and turn them into signals, deterministically or agentically. He points out that most agent products only offer hourly cron jobs, or one-off webhook plugins, and that listeners are a strict superset of both.
I agree with him, and Iโd go further: the trigger is the most underrated design decision in an agent. Pick the model last. Pick the trigger first. It decides how fast your agent reacts, what it costs to run, and whether it ever sees the event it was built for.
We built BuildShip around that idea: a workflow starts from a trigger, and the best triggers are listeners on systems you already own.
What is a listener for an AI agent?
A listener is a subscription to a stream of events. Instead of the agent asking โhas anything changed?โ, the source system tells the agent โthis changed, here are the detailsโ.
Events come from everywhere a business already records things:
Your database: a new row in
leads, an updatedorders.status, a deleted record.Your payments: a failed charge, a cancelled subscription, a refund.
Your inbox: an email to a support address.
Your tools: a GitHub issue, a Notion page, a form submission, a chat message.
Anything with a webhook: which these days is most SaaS products.
Each event carries a payload: what changed, and often the old and new values. That payload is the agentโs starting context.
Cron jobs vs listeners for AI agents
Cron is not evil. It is the right tool for โsend the weekly report every Monday at 9โ. It is the wrong tool for โreact when a customer does somethingโ, which is most of what people want agents for. Here is how they compare when an agent sits on the other end.
Cron job (poll every hour) | Listener (event trigger) | |
Reaction time | Up to 59 minutes, about 30 on average | Seconds |
Runs when nothing happened | Most of them | None |
Cost | Every run costs compute, and LLM tokens if the agent wakes up | You pay per real event |
Missed changes | Sees only the state at poll time. A row that is created and deleted between polls never existed | Each change fires its own event |
What the agent knows | โHere is the whole table, work out whatโs newโ | โThis row changed, from this to thisโ |
Overlap | A slow run can still be going when the next one starts | One run per event |
Duplicates | You maintain a โlast checkedโ watermark yourself | Expect retries, so key work on the event ID |

An hourly cron job against a listener on the same six events over a 12-hour day. The cron job runs 12 times, 7 of them on nothing, and reacts up to 57 minutes late. The listener runs six times, each within seconds.
The arithmetic is not subtle. Say a table gets three interesting events a day. An hourly cron job runs 24 times, so 21 of those runs, about 88%, find nothing. If each run wakes an agent and stuffs a batch of rows into its context, you are paying an LLM to read data it has already seen. Tighten the schedule to every five minutes to cut latency and you now have 288 runs a day for the same three events.
Missed events are the quieter problem. A poller sees snapshots. If a lead goes from new to qualified to lost between polls, the agent sees lost and none of the story. Listeners see the transitions, and the transitions are usually what the agent needed.
Why agents feel the cost of polling more than automations
Old automations could get away with polling because โcopy this row to that sheetโ is the same job now or in an hour. Agents are different. Their judgment goes stale (โshould we call this lead back?โ means something else an hour later). Every wake-up is a model call. And they reason best on the delta, not the dump: โorder 4812 went from paid to refundedโ beats โhere are 500 orders, find the interesting onesโ. A listener hands over exactly that delta, at the moment it matters.
Deterministic first, agentic second
Here is the part most people get wrong. A listener does not mean โcall the LLM on every event.โ That would just move the waste from the clock to the firehose.
John describes listeners that translate events into signals โeither deterministically or agenticallyโ. In practice you want both, in that order.

Most events should never reach a model. Plain code drops the noise, the agent handles judgment, and a person only sees the risky few.
Deterministic filter (free, instant, predictable). Plain code drops what is obviously irrelevant. Wrong table, wrong field, test accounts, amounts below a threshold, events your own workflow just caused. In BuildShip that is a Branch (If Else) or Switch node, or a few lines in a script node.
Agentic step (smart, slower, costs tokens). What is left needs judgment: is this email a complaint or a thank-you, is this lead a real company, does this refund look like fraud. That is where an AI step earns its keep. For simple routing, BuildShipโs AI Switch node classifies an input and sends it down the matching branch. For multi-step reasoning with tools, run an agent with the Execute AI Agent node.
Human step (for anything risky). If the agent wants to refund money, email a customer or delete data, it proposes, and a person approves.
Code is cheap and auditable, so let it do the dull filtering. Save the model for decisions only a model can make.
A walkthrough: a high-value lead agent on Supabase
Letโs make this concrete. You run a SaaS product with sign-ups in a Supabase leads table. You want an agent that reacts the moment a promising lead arrives, not in the next hourly batch.

The full flow. Each step shows up in BuildShipโs logs with its inputs, outputs and timing.
1. Listen to the table
Add the Supabase Trigger to a workflow. You authenticate with Supabase through OAuth, pick the project, set the schema to public and the table to leads, and choose the Insert event. When you connect it, BuildShip creates a database webhook on your Supabase project, so every new row starts a run with the row in the payload. (Updates and deletes work the same way. You can even listen to auth.users to react to new sign-ups.) We have a step-by-step Supabase webhook tutorial if you want screenshots.
On Firebase, BuildShipโs Firestore trigger does the same for documents that are created, updated, deleted or written. MongoDB has a trigger too.
2. Filter with code
Before any AI runs, drop the noise. A Branch node or a short script checks the obvious: is the email domain a free mail provider, is company_size under 10, is this one of our own test accounts. Anything that fails exits right there, at almost no cost.
3. Let the agent decide
Leads that pass go to an agent through the Execute AI Agent node. Its instructions are specific: research the company, score fit from 1 to 10 against our ideal customer profile, explain the score in one sentence, and suggest a first message. Give it a couple of narrow tools, such as โlook up this domainโ and โfind similar customersโ, rather than open access to everything.
4. Write the result back
The workflow saves the score, the reason and the suggested message to the lead row. Now your CRM view, your sales team and your next workflow all see the same thing. If you are writing back to the same table you are listening to, listen only to inserts (or skip events your own workflow caused) so the write doesnโt trigger the agent again.
5. Ask a human before anything risky
Scoring a lead is safe. Emailing a CEO on your behalf is not. For scores above 8, the workflow does not send anything. It writes a row to a pending_actions table with status pending and posts the draft to a Slack channel with a link to approve.
You can build the approval with the same primitives. The link calls a small BuildShip workflow behind a REST API trigger, which marks the row approved and sends the email. Or listen to pending_actions itself and send when the status flips. Either way, the approval is just another event, which is a nice property of building on listeners: humans are first-class event sources too.
6. Watch it run
Every run is logged node by node, with values and execution time, so when the agent scores a lead strangely you can see exactly what it saw. Each node can retry, stop the workflow or run a fallback flow when it fails (docs). And every nodeโs code is visible and editable: the canvas is a view of real JavaScript and TypeScript, not a wall in front of it.
Total moving parts: one trigger, one filter, one agent, one write, one Slack message. No server, no queue, no cron job.
Designing listeners per tenant
If you build for customers, every tenant has their own data and their own idea of what matters. A few patterns that work well:
Carry the tenant in the event. Put
tenant_idon every row, so every event payload already says whose it is. The workflow loads that tenantโs settings (thresholds, tone, which Slack channel) before the agent runs.Config in data, not in code. โNotify me about leads over 50 employeesโ should be a row in a
tenant_rulestable, not a hard-coded number. Changing it should not mean redeploying.Scope the agentโs tools to the tenant. The tool that looks up customers should only ever see the current tenantโs customers. Enforce that in the tool, not in the prompt.
One listener per source, not per customer, where you can. One trigger on a shared table, routed by
tenant_id, beats hundreds of near-identical workflows.
Where Johnโs essay points next is agents that create listeners themselves: โwatch emails from this customer this week and flag anything about renewalsโ. Today Compass, BuildShipโs AI builder, gets you part of the way by drafting workflows and agents from a prompt for you to review and ship. The listener stays a real trigger on a real system, with logs, versions and roles, which is what you want when an agent sets it up.
When cron is still the right answer
Listeners are a superset, not a replacement. Keep schedules for work that is truly about time:
Daily digests, weekly reports and clean-up jobs.
Sources with only a polling API. Poll on a schedule, write changes to your database, and let the rest run on events.
A nightly safety net for anything a webhook missed.
BuildShip has both custom cron schedules, with a time zone, and simple interval schedules. The point is to choose on purpose, not to default to โevery hourโ because that is all the platform offers.
What about Kafka, WebSockets and CDC?
Johnโs list of sources includes WebSockets, Kafka and change data capture (CDC). BuildShip doesnโt ship a dedicated Kafka or CDC connector, but you can build the pattern: have your stream processor forward the events you care about to a BuildShip workflow through a REST API trigger. For high-volume streams that is the right split anyway. Your streaming stack does the heavy lifting, and only meaningful events reach the agent.
Why BuildShip for event-driven AI agents
Listeners out of the box. Triggers for Supabase, MongoDB, Firestore, Stripe, GitHub, Notion, email, Telegram, WhatsApp and more, REST API triggers for any webhook, and schedules. A workflow can have several triggers.
Code-first, canvas as the view. Every node is real code you can read and edit.
Agents built in. Agent Max lets you build agents with tools, memory and human-in-the-loop approvals, and run them from any workflow.
Callable by outside agents. Ship a workflow as an API or as an MCP-ready tool, and Claude, Cursor or your own agent can call it. More in our guide to MCP tools for AI agents.
Built for teams. Version history on every shipped workflow, role-based access, and for enterprise teams, the option to run on your own Google Cloud project. See BuildShip for enterprise.
FAQ
What is an event-driven AI agent?
An event-driven AI agent runs when something happens, like a new database row, a payment or an email, instead of on a timer. The eventโs payload becomes the agentโs input, so it starts with exactly the context it needs.
Are webhooks and listeners the same thing?
A webhook is one way to deliver an event: the source sends an HTTP request when something changes. A listener is the broader idea of subscribing to changes, by webhook, database trigger, email or stream.
Should AI agents use cron jobs or webhooks?
Use webhooks or database triggers for anything that reacts to user or business activity. Use cron for work that is about time, like daily reports, clean-up and polling sources that have no webhooks.
How do I trigger an AI agent from a database change?
In BuildShip, add a database trigger (Supabase, MongoDB or Firestore) to a workflow, choose the table or collection and the event, then add the Execute AI Agent node. Every matching change runs the agent with the changed record as input.
How do I stop an agent from running on every event?
Filter with code first. A Branch or script node drops irrelevant events before any model is called, and the AI Switch node can route the rest by category. Only events that need judgment should reach the agent.
How do I add human approval to an AI agent?
Have the agent propose rather than act. Save the proposed action with a pending status, notify a person in Slack or email, and run the action only when they approve. In BuildShip the approval can call a workflow through a REST API trigger, or a database trigger can react when the status changes.
Build your first listener
Pick one cron job your agent runs today. Find the event it is really waiting for, the new row, the failed payment, the inbound email, and rebuild it as a listener. Most teams find the agent gets faster and cheaper in the same afternoon.
Start your 7-day BuildShip trial, connect a Supabase or Firestore trigger, and put an agent behind it. Plans start at $19 a month. If youโre building agents for a larger team, talk to us about enterprise.





