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.
15 questions · take it digitally for instant feedback at tendril.neural-forge.io/learn/quiz/end-openclaw-heartbeats-time-vs-event-creators
What is the core idea behind "Time-Based And Event-Based Heartbeats: Choosing The Trigger"?
Which term best describes a foundational idea in "Time-Based And Event-Based Heartbeats: Choosing The Trigger"?
A learner studying Time-Based And Event-Based Heartbeats: Choosing The Trigger would need to understand which concept?
Which of these is directly relevant to Time-Based And Event-Based Heartbeats: Choosing The Trigger?
Which of the following is a key point about Time-Based And Event-Based Heartbeats: Choosing The Trigger?
Which of these does NOT belong in a discussion of Time-Based And Event-Based Heartbeats: Choosing The Trigger?
What is the key insight about "Self-paced is powerful and dangerous" in the context of Time-Based And Event-Based Heartbeats: Choosing The Trigger?
What is the key insight about "Don't pick the trigger by feel" in the context of Time-Based And Event-Based Heartbeats: Choosing The Trigger?
What is the recommended tip about "Evaluate systematically" in the context of Time-Based And Event-Based Heartbeats: Choosing The Trigger?
Which statement accurately describes an aspect of Time-Based And Event-Based Heartbeats: Choosing The Trigger?
What does working with Time-Based And Event-Based Heartbeats: Choosing The Trigger typically involve?
Which of the following is true about Time-Based And Event-Based Heartbeats: Choosing The Trigger?
Which best describes the scope of "Time-Based And Event-Based Heartbeats: Choosing The Trigger"?
Which section heading best belongs in a lesson about Time-Based And Event-Based Heartbeats: Choosing The Trigger?
Which section heading best belongs in a lesson about Time-Based And Event-Based Heartbeats: Choosing The Trigger?