Cron vs webhooks

Cron runs on a clock; webhooks run on an event. A cron job checks every hour whether anything happened. A webhook fires the instant it does. For things that are time-sensitive — a deploy just finished, a PR just opened, a monitor just went red — a webhook is the difference between reacting now and reacting up to an hour late. They're complementary: cron for the routine, webhooks for the triggers.

Setup

The idea is to give OpenClaw a public endpoint that other services can POST to, then route that event to a task. The catch is that a public endpoint is, well, public — which is why the security section below is not optional.

# enable the webhook gateway and set a shared secret
openclaw config set webhook.enabled true
openclaw config set webhook.secret "a-long-random-string"

The exact keys vary by release, so check the webhook docs for the current spelling. Once it's on, you point GitHub (or your CI, or your monitoring tool) at the endpoint and give it the same secret.

Reading the payload

When the webhook arrives, the agent gets the raw event as context — a PR title, a branch name, a failed-check description. You write the task to use that: "When a webhook arrives, summarize what changed and post it to Telegram." The agent does the rest. The trick is to give it a narrow, concrete instruction so it doesn't try to act on every event with equal urgency.

The security layer

Anything on the public internet gets scanned and poked at. A webhook endpoint with no auth is an open door into your agent, and an agent that can run commands is a door into your machine. Three things that matter:

If any of that sounds like more than you want to maintain, keep webhooks internal-only — trigger them from services on the same network, not the open internet.