Loading lesson…
OpenClaw souls can wake on a clock, on a webhook, on a message, or on an internal signal. The trigger you pick shapes what kind of agent you actually have.
Every OpenClaw heartbeat reduces to a question: what makes the soul wake up? There are four answers worth knowing — interval, cron, event, and self-paced — and most production souls compose two or three of them.
The simplest trigger: 'wake every N seconds.' Good for monitoring loops, ambient awareness, gentle background reflection. The runtime keeps a timer; when it fires, the soul runs one beat and the timer resets.
soul: name: inbox-watcher heartbeat: type: interval every: 5m max_iterations: 200An interval heartbeat. Every 5 minutes, the soul wakes up and checks its inbox. After 200 beats it stops on its own — a safety cap we cover in lesson three.When 'every 5 minutes' isn't precise enough, a cron expression nails the soul to a calendar. Useful for daily digests, weekly summaries, end-of-month reports — anything that should run at a specific time, not a relative one.
soul: name: morning-briefing heartbeat: type: cron schedule: "0 8 * * 1-5" # 8:00 AM, weekdays only timezone: America/New_YorkA cron heartbeat fires the soul at 8 AM Eastern, weekdays only. The runtime handles DST; you handle the timezone.Sometimes the world should wake the soul, not the clock. Event heartbeats fire on incoming webhooks, queue messages, file changes, or other runtime signals. The soul reacts — but inside the agent loop, with full memory, not as a stateless handler.
soul: name: pr-reviewer heartbeat: type: event on: - webhook: github.pull_request.opened - webhook: github.pull_request.synchronize debounce: 30sWake on GitHub PR events. Debounce coalesces a flurry of pushes into a single beat — without it, a 10-commit push fires 10 reviews.The most agentic option: the soul itself sets the next beat. After running, it can return 'wake me in 90 seconds' or 'wake me when X arrives.' Useful when the rhythm depends on what the soul just learned — a slow heartbeat while idle, a fast one while a task is in flight.
| You want | Use | Why |
|---|---|---|
| Background reflection on memory | Interval (slow, e.g. 1h) | Doesn't need to be precise |
| 8 AM digest, weekdays only | Cron | Calendar-anchored, DST-safe |
| React to a webhook in seconds | Event | Latency matters; events carry context |
| A goal that needs faster polling while active | Self-paced + interval cap | Adaptive rhythm |
| Watch an inbox and write a daily summary | Event (on new mail) + Cron (8 AM digest) | Composed triggers |
| Free-running brainstorm with no real-time need | Cron once a day | Cheapest pattern that still feels alive |
The big idea: pick the trigger that matches the soul's job. Interval for ambient. Cron for calendar. Event for reactive. Self-paced for adaptive. Most production souls compose two.
8 questions · take it digitally for instant feedback at tendril.neural-forge.io/learn/quiz/end-openclaw-heartbeats-time-vs-event-creators
What is the main idea of "Time-Based And Event-Based Heartbeats: Choosing The Trigger"?
Which concept is most central to "Time-Based And Event-Based Heartbeats: Choosing The Trigger"?
Which use of AI fits this topic best?
What should a careful learner remember about "Self-paced is powerful and dangerous"?
You want to use AI after this lesson. What is the safest next step?
How should AI output about interval trigger be treated?
Name one way to verify an AI answer about interval trigger.
Which action would help you apply "Time-Based And Event-Based Heartbeats: Choosing The Trigger" responsibly?