Skip to content
Tutorial heart triggers heartbeat

Triggers, Schedules, and Heartbeats: How the Heart Primitive Makes Agents Autonomous

The difference between a chatbot and an agent comes down to one primitive: the Heart. A chatbot acts when a human types at it. An agent acts when its Heart fires. This spoke walks through the six trigger types, the heartbeat interval pattern, and the budgeting discipline that keeps autonomous agents from running away.

Six trigger types

Every Heart task carries a trigger. There are six types:

  1. Schedule — cron-like. "Run every weekday at 9am UTC." The most common; right for daily digests, periodic reviews, batch processing.
  2. Event — webhook or inbox. "Run when a new case lands in the queue." Right for reactive work.
  3. A2A — another agent. "Run when the senior-reviewer agent delegates to you." Right for composed work.
  4. Threshold — metric crossed. "Run when daily error rate exceeds 2%." Right for monitoring + ops.
  5. Heartbeat — interval poll. "Run every 5 minutes, decide if I should do anything." Right for ambient monitoring with self-deciding cadence.
  6. Manual — human-fired. "Run when an operator clicks Run Now." Right for tests + one-off escalations.

The same task can have multiple triggers. A common pattern: a tier-2 review agent fires on event (inbound case), heartbeat (check the queue every 5 min as a backstop), and manual (operator override). The substrate dedupes — a single case won't be reviewed twice.

The heartbeat interval

For heartbeat-triggered tasks specifically, the interval shapes the agent's cost + responsiveness profile:

  • 1–5 minutes — high responsiveness, high cost. Right for customer-facing agents during business hours.
  • 15–60 minutes — medium. Right for ops-facing agents, internal workflows.
  • 2–6 hours — low cost, batch-y. Right for background work that doesn't need to be fast.
  • Daily / weekly — use schedule, not heartbeat. Schedules fire on a calendar; heartbeats poll on a clock.

A pattern we see often: business-hour heartbeats at 15 minutes, overnight heartbeats at 2 hours. The substrate's per-task config supports this directly (heartbeat_interval_minutes: { business_hours: 15, overnight: 120 }).

Per-task budgeting — the discipline

Autonomy without budgets is a runaway agent. The Heart enforces budgets at three levels:

  • Per-call token budget. Cap the LLM call's input + output tokens. Right for tasks that should be bounded (a routine reply shouldn't ever burn 200K tokens).
  • Per-task daily budget. Total spend per task per day. Caps the autonomy radius.
  • Per-agent monthly ceiling. The firm-level guardrail. When breached, the agent pauses pending operator review.

Without these, a misconfigured agent (one that retries on every failure, or that gets stuck in a reasoning loop) burns a month's LLM bill in an afternoon.

Pattern: shadow-mode rollout

When deploying a new task, the safe pattern: set the trigger but disable the action side. The agent runs through its decision logic and logs what it would have done; humans review for a week; then the action side is enabled.

The substrate supports this via a shadow_mode: true flag at the task level. Episodic memory captures the agent's would-be decisions; the operator dashboard exposes a diff between agent decisions and human decisions on the same cases. When the diff stabilises at <5% disagreement, shadow-mode is flipped off.

FAQ

Q: Can a task have no trigger?
A: Then it's just a function definition, not a task. The Heart only fires triggered tasks.

Q: What's the minimum heartbeat interval?
A: 1 minute. Below that, you're better off using event triggers.

Q: How is per-call budget enforced?
A: Pre-call check against the model provider's pricing × estimated token count. If estimate exceeds budget, the task fails fast with BudgetExceeded — captured in the audit log, surfaces in the operator queue.

Q: How does this map to the 8 primitives?
A: Heart is the autonomy primitive. Identity is who. Heart is when. Brain is how. Memory is what happened. Together: an autonomous, auditable agent.


Want to configure a heartbeat schedule? Start free →

🚀 Ready to build this yourself?

Create the agent described in this article in under 2 minutes — no code required.

Try It Free → Book a Demo
Share this article
𝕏 Share 🔗 LinkedIn
Playbooks

Turn this into a working agent

Browse all playbooks →

Ready to build this agent?

Setup takes less than 2 minutes. No coding required.

Start Building Free →
Image
Copy link
X
LinkedIn
Reddit
Download