Scheduling put your agents on a clock. But some work cannot wait for the clock: it has to happen the instant something occurs. That is the other half of autonomy, the reflex, and it is what this short chapter adds.
3.13.1Scheduled is proactive, triggered is immediate
A scheduled agent asks, "is it time yet?" A triggered agent asks, "did the thing happen?"
The first is a heartbeat, steady and periodic. The second is a reflex, dormant until an event pokes it, then instant. A serious system has both: the heartbeat does the rounds, the reflex catches the fire the moment it starts.
3.13.2Some problems can't wait for the next sweep
A payment fails. A key expires. An error spikes. If your only mechanism is a schedule, the damage runs until the next tick fires.
Reflexes exist for exactly the events where the gap between "it happened" and "we responded" has to be near zero. You do not schedule a smoke detector to check for fire each morning; you wire it to react the instant there is smoke.
Here is the whole loop on one event. An error lands in the ledger. The reflex wakes, pulls the real context, the stack trace, the recent changes, the live state, and works out what broke. Then it splits on the guardrails you already set: if the fix is safe and reversible it makes it, proves it with a test, and ships it through review; if it would cost money or touch user data, it does not act, it files a decision card and stops. Investigating is always safe, so that part is fully automatic; only the risky call waits for you.
3.13.3Triggers listen to the ledger
A reflex is an agent watching the event stream for one specific line. Something has to do the watching, and the simplest version is a small watcher on a tight loop: it reads new lines in the ledger every few seconds, and when a line matches, it runs the right agent. Bigger setups let the alerting tool itself call a web address the moment it fires, but the idea is the same, a rule that maps an event to an agent:
on event alert.fired -> run incident-responder
on event payment.failed -> run billing-retry
This is why the ledger comes first: without one honest stream of events, there is nothing to watch. With it, any event can become a trigger.
3.13.4Together they cover the whole clock
Heartbeat plus reflex is complete coverage of time. The scheduled agents handle the rhythm of the work, the routine that happens on a cadence. The triggered agents handle the surprises, the events that arrive on their own and demand a response now.
Between the two, nothing falls through: if it happens on a clock, the heartbeat has it; if it just happens, a reflex catches it.
Hint: reach for reflexes once you have a ledger and a few events that genuinely cannot wait for the next scheduled run.
3.13.5Wire your first reflex
This prompt gives your system its first reflex:
Act as a senior engineer adding an event-driven trigger to
my system. Pick the one event that most needs an instant
response, watch my event log for it, and run the right agent
the moment it lands. Use an approach that works on my
operating system. Keep the agent's job small and safe,
inside the guardrails I already set.
My operating system, event log, and the event that can't wait:
Do this now: paste the prompt and wire one reflex to the single event you would hate to catch a day late.