WhatsApp Web
Your personal WhatsApp through WhatsApp Web in a headless browser, read chats and messages, send text and files (low volume, rate limited)
Experimental v0.2.0 Node.js 7 actions ToS risk high
About
A Graphrt plugin that drives your personal WhatsApp through WhatsApp Web in a headless Chromium (Playwright). You scan a QR code once, after that, workflows and agents can read chats and messages and send text and files in the background.
What it can do
- Session: login (node only) opens a visible window with the QR code. get_status reports logged_in, needs_login or loading.
- Reading: - list_chats: name, last message preview, time and unread count, with unread_only. A chat you marked as unread counts as 1 unread. Two chats with the same name are both listed. - search_chats: uses the WhatsApp search box. Returns chat and contact rows only (each with kind: chat or contact), section headers and message hits are left out. - read_messages: the last N messages of a chat. Each message has id, from_me, sender, time, text and delivery status.
- Sending: - send_message: sends to a phone number or to an existing chat by its exact name, then checks that the message appears as sent. - send_file: sends a photo, video or document from an allowed local directory or an https URL, with an optional caption.
- Safety: - A minimum interval between sends (30 s by default), and a daily cap that is stored in the profile directory. If the counter file is unreadable or corrupt, sending is blocked until you fix or delete it. - No automatic retries. Every send is logged to stderr. - Local files must be inside WHATSAPP_WEB_ALLOWED_FILE_DIRS. URL downloads are streamed and stop at 100 MB. - Before every send the plugin clears the message (or caption) box, types the text, and then checks that the box holds exactly that text. If it doesn't, or the run was cancelled, nothing is sent.
- One browser per plugin process: - It starts on the first operation and runs operations one at a time. - It closes after WHATSAPP_WEB_IDLE_MINUTES without use, and when Graphrt stops the plugin. When Graphrt closes the plugin's input, running operations get up to 60 s to finish and reply first, a signal (SIGTERM/SIGINT/SIGHUP) closes the browser at once. - A lock file in the profile keeps a second plugin process off the same profile. A lock left by a dead process is taken over.
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- Log in to WhatsApp Web
whatsapp-web.login - WhatsApp Web status
whatsapp-web.get_status - List WhatsApp chats
whatsapp-web.list_chats - Search WhatsApp chats
whatsapp-web.search_chats - Read WhatsApp messages
whatsapp-web.read_messages - Send WhatsApp message
whatsapp-web.send_message - Send WhatsApp file
whatsapp-web.send_file
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
WHATSAPP_WEB_PROFILE_DIR~/.graphrt/whatsapp-web/profileChromium profile holding the WhatsApp session, the send counters (graphrt-send-state.json) and a lock file (graphrt-whatsapp-web.lock) -
WHATSAPP_WEB_IDLE_MINUTES15Close the background browser after this many idle minutes -
WHATSAPP_WEB_MIN_SEND_INTERVAL_SECONDS30Minimum gap between two sends. Bursts of sends from a personal account risk a ban, so keep it high. Waits of up to 60 s happen inline, a longer wait fails with rate_limited -
WHATSAPP_WEB_DAILY_SEND_LIMIT50Sends per local calendar day. 0 disables sending -
WHATSAPP_WEB_ALLOWED_FILE_DIRS(none)Comma-separated directories send_file may read local files from. When it is unset, only https URLs work
How to use it
In Graphrt Desktop
- Open Plugins and search for WhatsApp Web.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
terminal
$ graphrt plugin install whatsapp-web --yes workflow.yaml
- { id: unread, type: whatsapp-web.list_chats, unread_only: true, limit: 10 }
- { id: history, type: whatsapp-web.read_messages, chat_name: "Ibu", limit: 20 }
- { id: reply, type: whatsapp-web.send_message, phone: "+62 812 3456 789", text: "On my way" }
- { id: photo, type: whatsapp-web.send_file, chat_name: "Family", file: "https://example.com/photo.jpg", caption: "Look!" }