· 6 min read
The job I moved from a schedule to an event
Why I pulled one automation job off its cron schedule and wired it to fire on an event instead, and what that trade actually costs and buys you.
The job in question
I run a handful of automation jobs that move video files, tag content, and hand work off to AI agents. One of them used to run every five minutes on a cron schedule. Its whole purpose was to check a folder for a finished render, then kick off the next step: pulling metadata, generating captions, queuing the upload. Simple job, dumb schedule.
It worked. It also woke up every five minutes, looked at an empty folder about 90% of the time, and went back to sleep. When a render actually did land, the job could be waiting anywhere from a few seconds to almost five minutes before it noticed. Not a disaster, but not great either, especially when a render finishes at 11:58 and the next check isn’t until 12:03.
Eventually I moved it off the schedule entirely and had the renderer fire an event the moment it finished writing a file. The polling job disappeared. Now something happens, and the automation reacts to that something. That’s the whole idea behind event driven automation, and it’s a smaller shift than it sounds like, but it changes how you have to think about the job.
What a schedule actually is
A cron schedule is a bet. You’re guessing how often something interesting is likely to happen, and you set your check interval around that guess. Every five minutes, every hour, every night at 2am. The job doesn’t know or care whether anything changed. It just runs, looks, and either finds work or doesn’t.
That’s fine when the thing you’re checking for is cheap to check and the timing doesn’t matter much. Backing up a database at 3am, sure, nobody needs that to happen the instant a row changes. But when the check itself does real work, like listing a directory, hitting an API, or spinning up a process just to find out there’s nothing to do, you’re spending real cycles on “nope, still nothing” over and over.
The other cost is latency, and it’s baked into the schedule by definition. Average wait time is roughly half your interval. Five minute schedule, two and a half minute average delay before anyone reacts. If the next step downstream is an AI agent that summarizes the video and writes a description, that agent is now sitting idle for a chunk of every hour for no reason other than the clock hasn’t ticked yet.
What an event actually is
An event driven job flips the direction of who decides when to act. Instead of a job asking “did anything happen?” on a timer, the thing that produces the work tells the job “this happened” the moment it’s true. In my case, the renderer already knows exactly when it finishes writing the output file, because it’s the one writing it. So instead of some other process guessing when to go look, the renderer just says so.
Mechanically this can be a file system watcher, a webhook call, a message dropped on a queue, or a signal from one process to another. What they all have in common is that the trigger comes from the actual state change, not from a clock. Nothing runs until there’s something to run for.
For the render job I used a file system watcher on the output directory. When the renderer closes the file handle on a finished MP4, the watcher fires and hands the filename straight to the next step. No five minute lag, no idle folder checks. The agent that writes captions and descriptions starts working within a second or two of the render actually being done, because it’s reacting to the render, not to a clock that has no idea the render exists.
What actually changed, concretely
Three things changed when I made this switch, and none of them are dramatic.
The wasted checks went away. There’s no process waking up every five minutes to look at nothing. That’s not a huge resource saving on one job, but it’s the kind of thing that adds up once you’ve got a dozen jobs each polling their own folder or endpoint on their own schedule.
The delay between “work is ready” and “work starts” dropped from an average of a couple minutes to something closer to instant, because the trigger fires at the exact moment the condition becomes true instead of at the next scheduled check.
And the job got simpler to reason about, in one specific way: it no longer needs to ask “is this the render I already processed, or a new one?” On a schedule, every run has to check what it saw last time and diff against what’s there now, because the same folder gets looked at repeatedly. An event only fires once, for one specific thing, so there’s no bookkeeping about what’s already been handled.
What got harder
I want to be straight about the tradeoff, because event driven setups aren’t strictly better, they’re different, and they carry their own failure modes.
A schedule is self-healing in a dumb, reliable way. If a run fails or gets skipped, the next one comes along in five minutes and picks up whatever’s sitting there. An event, by contrast, only fires once. If the watcher process is down when the renderer finishes, or the webhook call fails to land, that event is gone. Nothing comes along later to notice the miss, because there’s no “later” built into the design, there’s only “when it happens.”
So the event-driven version needs something the scheduled version got for free: a way to detect and recover from a missed trigger. I ended up keeping a much slower backup schedule, once an hour, purely as a safety net that catches anything the event system dropped. It’s not doing the primary job anymore. It’s just there to catch the rare miss.
The other real cost is that event driven jobs are more coupled to the thing producing the event. My caption job now depends on the renderer correctly signaling “done,” which means a change to the renderer’s file-writing behavior can silently break the trigger downstream. A scheduled job doesn’t care how the file got there, it just looks at the folder. That decoupling is worth something, and you give some of it up when you wire two processes together directly.
Where the schedule still wins
Not everything should move. The jobs I’ve left on a schedule are the ones where timing doesn’t need to be tight and there’s no natural moment to hook into. Cleaning up temp files, checking disk usage, rotating logs. Nothing produces a clean “this changed” signal for those, and nothing downstream is waiting on them urgently. Forcing those into an event model would mean inventing an event just to have one, which is more complexity for no real gain.
The test I use now is pretty simple: does something in the system already know the exact moment the condition becomes true? If yes, that’s a signal worth wiring up directly. If the honest answer is “I’d have to keep checking to find out,” a schedule is still the right tool, and there’s no shame in that.
The actual lesson
Moving this one job off a schedule didn’t make my automation smarter or turn it into something it wasn’t. It just meant the job started reacting to reality instead of guessing at it on a timer. That’s the whole value of event driven automation: less time spent asking “did anything happen,” more time acting the instant it does, in exchange for taking on responsibility for noticing when a signal goes missing. Worth it for the jobs where timing matters and a real trigger exists. Not worth inventing for the ones where it doesn’t.
If you’re building out AI agents, local render pipelines, or MCP-driven workflows and want to see how these decisions play out in practice, you can find more of this on the home page.
Get new guides and videos first — join the Telegram channel.