Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

openclaw-webhooks

БесплатноЗапускает вложенные скриптыНе проверен

Receive and verify OpenClaw automation (cron) webhooks. Use when handling the finished-run POSTs OpenClaw sends with Authorization: Bearer <webhookToken>…

hookdeckот hookdeck★ 104 звезды на GitHub

Об этом скилле

OpenClaw Webhooks

When to Use This Skill

  • Receiving the webhook OpenClaw POSTs when an automation (cron job) finishes (--webhook <url>)
  • Verifying the Authorization: Bearer <webhookToken> header on those POSTs
  • Handling finished-run events and failure alerts from OpenClaw automations
  • Calling an OpenClaw Gateway's inbound hooks (/hooks/agent, /hooks/wake) from your service (see Calling OpenClaw's Inbound Hooks)

Receiving Webhooks from OpenClaw

OpenClaw automations (cron jobs) can deliver their output to a URL. From Manage automations:

Use --webhook <url> on automations add|create or automations edit to POST the finished run payload to an HTTP endpoint

webhookToken is sent as Authorization: Bearer <token> on automation webhook POSTs.

The body is JSON and is not signed, so the Authorization header is the whole check. Compare the entire header value with Bearer <webhookToken> in constant time. In Hookdeck's OpenClaw source, paste the bare webhookToken into the Webhook Token field. OpenClaw only sends the header when cron.webhookToken is set, so always set it.

Token Verification (JavaScript)

const crypto = require('crypto');

// Compare the whole Authorization value with "Bearer <webhookToken>"
function verifyOpenClawWebhook(authorizationHeader, webhookToken) {
  if (!authorizationHeader || !webhookToken) return false;
  const received = Buffer.from(authorizationHeader, 'utf8');
  const expected = Buffer.from(`Bearer ${webhookToken}`, 'utf8');
  return received.length === expected.length && crypto.timingSafeEqual(received, expected);
}

Express Webhook Handler

const express = require('express');
const app = express();

// express.raw keeps the exact bytes; parse JSON only after the token check
app.post('/webhooks/openclaw', express.raw({ type: '*/*' }), (req, res) => {
  if (!verifyOpenClawWebhook(req.get('authorization'), process.env.OPENCLAW_WEBHOOK_TOKEN)) {
    return res.status(401).json({ error: 'Invalid token' });
  }

  const event = JSON.parse(req.body.toString('utf8'));
  if (event.action === 'finished') {
    console.log(`Automation ${event.job?.name || event.jobId}: ${event.status}`, event.summary || event.error);
  }

  res.status(200).json({ received: true }); // any 2xx counts as delivered
});

Token Verification (Python)

import hmac

def verify_openclaw_webhook(authorization_header: str | None, webhook_token: str) -> bool:
    if not authorization_header or not webhook_token:
        return False
    return hmac.compare_digest(authorization_header.encode(), f"Bearer {webhook_token}".encode())

For complete working examples with tests, see:

Finished Event Payload

Delivery modes: "webhook | POST finished event payload to a URL". The payload is the run's finished event:

Source, not docs. OpenClaw's docs only say "POST finished event payload to a URL" and don't list its fields. The fields below come from OpenClaw's source at commit 5dc91d6: the CronEvent type (src/cron/service/state.ts), buildCronFinishedWebhookPayload, which drops summary and diagnostics on error events, and the POST with Authorization: Bearer (both in src/gateway/server-cron-notifications.ts). Field names can change between releases, so read them defensively.

{
  "jobId": "job_123",
  "action": "finished",
  "runId": "run_abc",
  "runAtMs": 1767268800000,
  "durationMs": 4200,
  "status": "ok",
  "completionStatus": "succeeded",
  "summary": "Three deploys today, all green.",
  "job": { "id": "job_123", "name": "Deploy digest" },
  "nextRunAtMs": 1767355200000
}
Field Description
action Always finished for this delivery
jobId, job The job ID and a snapshot of the job
runId, runAtMs, durationMs The run's ID, start time (ms) and duration
status Execution status, e.g. ok or error
completionStatus e.g. succeeded or failed (a run can be status: "ok" with completionStatus: "failed")
summary The run's output. Omitted on error events
error Error text on failed runs
nextRunAtMs Next scheduled r
Полный SKILL.md на GitHub

Установить openclaw-webhooks в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/express/.env.exampleexamples/express/README.mdexamples/express/package.jsonexamples/express/src/index.jsexamples/fastapi/.env.exampleexamples/fastapi/README.mdexamples/fastapi/main.pyexamples/fastapi/requirements.txtexamples/fastapi/test_webhook.pyexamples/nextjs/.env.exampleexamples/nextjs/README.mdexamples/nextjs/app/webhooks/openclaw/route.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

Что делает скилл openclaw-webhooks?

Receive and verify OpenClaw automation (cron) webhooks. Use when handling the finished-run POSTs OpenClaw sends with Authorization: Bearer <webhookToken>, processing automation results or failure alerts, or calling an OpenClaw Gateway's inbound /hooks/agent and /hooks/wake endpoints.

Как установить скилл openclaw-webhooks?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл openclaw-webhooks запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить openclaw-webhooks с