Skip to content

Automation & Cron

TL;DR: Sam has one cron job (broken) and a heartbeat system driven by a markdown file. There are no webhooks, no event-driven automation, and no Gmail PubSub — despite having all the credentials to set them up.

The Two Automation Systems

OpenClaw provides two distinct automation mechanisms, and Sam uses both in an overlapping, slightly conflicting way:

SystemPurposeConfig MethodCurrent State
HeartbeatPeriodic check-ins from the main sessionHEARTBEAT.md file instructions🟡 Working but over-scheduled
CronIsolated, scheduled agent runscron/jobs.json🔴 1 job, breaking (timeout)

The Conflict

The cron job (funnel-github-watch) runs every 30 minutes to check GitHub. The heartbeat (3×/day at 10am, 2pm, 6pm PT) also checks GitHub as part of its window tasks. Result: GitHub is being checked too often, sometimes by two systems simultaneously, with John having told Sam five times to stop the constant reporting.


Heartbeat

Configuration

The heartbeat is not configured in openclaw.json — it's entirely driven by HEARTBEAT.md in the workspace, which Sam reads at the start of each heartbeat poll.

The heartbeat prompt that triggers Sam is:

"Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK."

Schedule

Sam has tightened the heartbeat schedule over time. The current HEARTBEAT.md specifies:

Only act at these 3 windows (PST):

  • 10:00 AM (5:00 PM UTC)
  • 2:00 PM (9:00 PM UTC)
  • 6:00 PM (1:00 AM UTC)

If not within 30 minutes of those windows: reply HEARTBEAT_OK and do nothing.

This was added after John complained 5+ times about constant commit reports.

Tasks at Each Window

At each of the 3 daily windows, Sam performs:

  1. Check sam-chat (C0AJVMAHM50) — read last 15 messages, respond if needed
  2. Check funnel-squad (C0AJ67B5VP1) — read last 10 messages, respond if needed
  3. Funnel & test tracking — post to sam-chat with:
    • Overall funnel CVR (landing → purchase), target 1.5%
    • Order Bump: AOV, purchases, upsell rate vs baseline
    • SMS Disclaimer: lead view → lead CVR, baseline 74.7%
    • SEMA route tracking (reverted to SEMA 3/17)
    • Mounjaro routing tracking (new 3/17)
    • Express Pay tracking (new 3/17)
    • DM John only if >5% shift
  4. GitHub funnel monitor — check funnel, funnel-cms, landing-pages, checkout repos silently; log to memory/funnel-changes.md; alert John ONLY if change correlates with >5% CVR shift

Heartbeat History Note

Before the current tight schedule, Sam was:

  • Reporting GitHub commits every single heartbeat (every ~30 min)
  • Posting to sam-chat continuously
  • Checking PostHog data outside scheduled windows

This led to multiple complaints from John. The HEARTBEAT.md was progressively tightened with explicit STOP commands.


Cron Job

funnel-github-watch

json
{
  "id": "22b4d31f-04ec-475e-8614-6acc60c85994",
  "name": "funnel-github-watch",
  "description": "Check FuturHealth GitHub repos for new code pushes every 30 min. Alert John on changes.",
  "enabled": true,
  "schedule": {
    "kind": "every",
    "everyMs": 1800000
  },
  "sessionTarget": "isolated",
  "wakeMode": "now",
  "payload": {
    "kind": "agentTurn",
    "timeoutSeconds": 90,
    "lightContext": true
  },
  "delivery": {
    "mode": "announce",
    "channel": "slack",
    "to": "U06BQPTAE1H"
  }
}

Current state:

json
"state": {
  "lastRunStatus": "error",
  "lastStatus": "error",
  "lastDurationMs": 90008,
  "consecutiveErrors": 1,
  "lastError": "cron: job execution timed out"
}

Problems:

  1. Timing out at exactly 90,008ms — the 90-second timeout is being hit consistently
  2. Running every 30 minutes — despite HEARTBEAT.md saying to only check GitHub 3×/day
  3. Conflicting with heartbeat — both systems attempt GitHub monitoring
  4. Delivering to John directly — but heartbeat also posts to sam-chat. Two systems, overlapping outputs.

Why it's timing out: The cron job tries to authenticate with GitHub API, check 4 repos, compare SHAs, log to funnel-changes.md, and potentially send a Slack DM — all in 90 seconds. With any network latency or GitHub rate limiting, this fails.

Fix: Either disable this cron job (rely on heartbeat's GitHub check instead) or extend the timeout and fix the GitHub check script.


Delivery Queue

.openclaw/delivery-queue/
└── failed/    # Empty — no failed messages

No failed deliveries in queue. Messages from cron jobs and heartbeats have been delivered successfully to Slack when they do complete.


What's Not Configured (But Should Be)

Gmail PubSub

What it is: OpenClaw supports receiving Gmail push notifications via Google Cloud PubSub. Sam already has Google OAuth tokens for john@fh.co and johnlevan1@gmail.com.

What it would enable: Instead of polling Gmail every 30 minutes, Gmail pushes notifications to Sam instantly when important emails arrive.

Config needed:

json
"hooks": {
  "enabled": true,
  "mappings": [
    { "match": { "path": "gmail" }, "action": "agent", "agentId": "main" }
  ]
}

Webhooks / Hooks

What they are: HTTP endpoints on the gateway that external services can POST to.

What they would enable:

  • GitHub webhooks → Sam gets notified of pushes instantly (no need to poll every 30 min)
  • Zapier/Make integrations
  • Custom event triggers from FuturHealth's own systems

Polls

What they are: OpenClaw's poll automation type — check an endpoint on a schedule and trigger only when data changes.

What they would enable: More efficient data checks without running a full agent turn for each poll.


Summary: Automation Problems

ProblemImpactFix
Cron job timing out every 30 minWasted compute + incomplete GitHub monitoringDisable cron or extend timeout + fix script
Heartbeat + Cron checking GitHub simultaneouslyDuplicate work, duplicate alertsConsolidate into one system
No webhooks configuredSam polls rather than reactsAdd GitHub + Gmail webhooks
No heartbeat config in openclaw.jsonSchedule not enforced by runtimeAdd agents.defaults.heartbeat.every
No Gmail PubSubEmail scanning is 30-min delayedSet up Gmail PubSub hook

See also: Configuration | Known Issues | GitHub Monitoring Workflow

FuturHealth Internal — Confidential