DEV Community

Farrukh Hewson
Farrukh Hewson

Posted on

AI agents should run on triggers, not on a schedule

I wanted an automation that watches my Gmail. I set it up the way everyone sets these things up, on a schedule, and it was checking my inbox every 5 minutes. Even when nothing had arrived.

Every one of those checks woke the AI up. It read the empty inbox, found nothing and went back to sleep. 5 minutes later, same thing again. My model limits were draining way too fast and I had nothing to show for it.

If you've ever built a poller, you know this already. It's the same reason we moved from polling APIs to webhooks. You don't ask a server "anything new?" every few seconds, you let it tell you. Somehow we forgot all of that the moment an LLM got involved.

Triggers instead

With a trigger the agent sleeps until something actually happens. An email arrives, an error shows up in the logs, a transaction comes in. Only then it wakes up, looks at the thing and decides. Most of the time it skips it, sometimes it pings me. Then back to sleep.

A schedule pays for the AI to think every time, whether there's anything to think about or not. A trigger pays only when there's something real.

What I run this way

Mail filtering is the main one. When a mail arrives, the AI wakes up to analyze it and either skips it or pings me.

Error logs work the same way. Nothing runs until an error appears, then the agent looks at it and tells me if it matters.

I also keep my finances in Notion, and I get daily stats across my products without opening five dashboards.

Cron still has its place. A morning summary at 7:00 genuinely runs on time, so a schedule is fine there. But if an event can tell you something happened, don't poll for it.

How I got here

I used OpenClaw before. The first few weeks everything felt novel, then I realized it was taking more time to maintain than it was saving me. Something would break, I'd spend an evening fixing it, then something else would break.

But I liked the whole idea so much that I built my own iOS app, PocketClaw, and now I'm daily driving it.

It's trigger based, so the Gmail problem above doesn't happen. It's not tied to one model either, so I pick Claude, GPT, Gemini or something cheaper per task. A simple "is this email important" check doesn't need an expensive model. It has 50+ connectors, and the agent has its own cloud computer and file system, so it can run scripts, extract data and make PDF reports. Nothing to set up or maintain on my side, which was the whole point after the OpenClaw weeks.

I use it daily myself, so I'm constantly improving it. It starts at $5/month, give my own app a go if you want to see how a trigger-based agent feels.

And if you're building your own agents, even a script that calls an API, look at where you're polling. Most of the time something is already sending you the event, you're just not listening to it.

Top comments (0)