- Strict Inbound Lockdown: Zero automated replies to DMs or groups (
dmPolicy: "disabled",groupPolicy: "disabled"), eliminating hallucination and privacy leakage risks. - Outbound-Only Editorial Agent: Daily cron-triggered (02:00 UTC) pipeline fetches WordPress content & project catalogs, generates 15+ platform-specific drafts via OpenRouter (Llama 3.3 70B), and delivers a tap-to-copy WhatsApp kit.
- Protocol-Native Formatting: Uses Baileys/WA Web multi-device protocol with WhatsApp-native
bold,italic,monospace, and bullet lists—no Markdown tables or HTML tags that break rendering. - Human-in-the-Loop Control: Dispatcher sends drafts for review; zero auto-posting to social networks. User copies, edits, and publishes manually.

The Engineering Challenge: Why OpenClaw WhatsApp API Channel & Daily Social Dispatcher Was Architected
Maintaining a high-signal developer presence across X/Twitter, Threads, Instagram, Facebook Pages, Bluesky, Quora, TikTok, Reddit, Substack, Product Hunt, AlternativeTo, SaaSHub, BetaList, There’s An AI For That, Futurepedia, DevHunt, and Peerlist demands platform-native copy—character limits, formatting conventions, hashtag strategies, and visual cues differ wildly. Manual drafting consumes 30–60 minutes daily; generic auto-posters risk typos, broken links, and reputational damage.
Simultaneously, standard WhatsApp bot integrations introduce critical attack surfaces: auto-replies in DMs leak private context, group-chat bots spam collaborators, and Markdown/HTML payloads render as garbled text on mobile. The OpenClaw WhatsApp API channel solves both problems by enforcing a unidirectional, outbound-only contract: the gateway never listens, never replies, and never posts autonomously. It delivers a curated, copy-ready kit to a single verified recipient every morning at 09:00 WIB (02:00 UTC).
Core Architecture & Technical Stack Deep-Dive
System Topology & Process Boundaries
The deployment runs on a single Linux node (/home/thirzq/.openclaw) with three isolated process boundaries:
┌─────────────────────────────────────────────────────────────────────────────┐
│ LOCAL HOST (Linux Node) │
│ │
│ ┌──────────────────────────┐ HTTPS ┌──────────────────────────┐ │
│ │ Cron Scheduler (0 2 * * *)│ ─────────────▶ │ OpenRouter Inference API │ │
│ │ scripts/daily-social-post.js│ │ (meta-llama/llama-3.3-70b)│ │
│ │ Reads: project_catalog.json │ └──────────────────────────┘ │
│ │ articles_log.json │ │ │
│ │ State: daily_social_history.json │ │
│ └──────────────┬─────────────┘ ▼ │
│ │ ┌──────────────────────────┐ │
│ │ IPC / WebSocket │ OpenClaw Core Gateway │ │
│ └───────────────────▶│ (openclaw message send) │ │
│ │ Channel: whatsapp │ │
│ └───────────┬──────────────┘ │
│ │ Baileys / WA Web │
│ ▼ │
│ ┌──────────────────────────┐ │
│ │ WhatsApp Multi-Device │ │
│ │ Protocol (Baileys) │ │
│ │ Recipient: +6281290765711│ │
│ └──────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
- Scheduler:
cron-daily-social.shtriggersnode scripts/daily-social-post.jsat 02:00 UTC daily. - Ingestion Layer: Reads local JSON sources—
project_catalog.json(server architectures, tech stacks) andarticles_log.json(WordPress posts fromhttps://wordpress.nevatal.id). - Deduplication State:
daily_social_history.jsontrackscontent_id,content_type(article/project),title, anddate_sent(YYYY-MM-DD) to prevent repeat delivery. - LLM Inference: Single-call OpenRouter request (
meta-llama/llama-3.3-70b-instruct,temperature: 0.7,max_tokens: 4000) with a strict system prompt enforcing 15+ platform schemas. - Gateway IPC: OpenClaw CLI (
openclaw message send --channel whatsapp --recipient --message) hands off to the persistent Baileys socket. - Transport: Baileys maintains the WhatsApp Web multi-device session (QR pairing once; session persisted in
~/.openclaw/auth/).
Data Layer & Cache Strategy
| Store | Format | Purpose | Retention |
|---|---|---|---|
project_catalog.json |
JSON Array | Canonical project metadata (name, stack, description, repo URL) | Append-only, manual curation |
articles_log.json |
JSON Array | WordPress post index (slug, title, date, categories, excerpt) | Synced via WP REST API webhook |
daily_social_history.json |
JSON Array | Deduplication ledger: {content_id, content_type, title, date_sent} | Indefinite (audit trail) |
~/.openclaw/auth/ |
Baileys Auth State | Signal Protocol keys, noise tokens, pre-keys | Persistent across reboots |
Performance Benchmarks & Latency Profile
- Cold-start Cron → WhatsApp Delivery: ~12–18 seconds end-to-end (LLM inference dominates at 8–12s).
- OpenRouter Llama 3.3 70B Latency: P50 ~9s, P95 ~14s for 4k-token structured output.
- Baileys Send Latency: <500ms post-gateway handshake (persistent WebSocket).
- Memory Footprint: Node.js 26 process ~85 MB RSS idle; ~140 MB during LLM streaming.
- Failure Recovery: Cron job exits non-zero on LLM timeout (>30s) or gateway error; systemd/logrotate captures stderr for alerting.
Key Features Breakdown & Practical Benefits
1. Strict Inbound Lockdown (Security Boundary)
Configuration flags dmPolicy: "disabled", groupPolicy: "disabled", and selfChatMode: false are hard-coded in the Baileys listener. The event loop does not register messages.upsert handlers for inbound traffic. Result: zero attack surface for prompt injection, context leakage, or group spam.
2. Multi-Platform Copy Kit Generation (15+ Targets)
The system prompt enforces a rigid JSON schema covering:
- \
500ms>
Leave a Reply