Most "self-hosted WhatsApp" setups mean a VPS, a Docker container, and a monthly bill for a process that spends 99% of its life waiting. This one is a Cloudflare Worker: one Durable Object per linked account drives the WhatsApp Web session, and you pay nothing at low volume.
GitHub: https://github.com/dannybyarun/whatsflare (MIT)
Why the architecture looks odd. Cloudflare gives 13,000 GB-s of Durable Object time per day. A DO holding a WhatsApp socket bills 128 MB × 86,400 s ≈ 10,800 GB-s, so a single always-on session would eat 83% of the entire free tier. The session is therefore lazy: /wake opens the socket, /messages drains with a monotonic cursor, /ack prunes once you have persisted the rows, /idle closes it. A window slides on activity but is capped, so a drain that takes 90 s finishes and a poller on a tight loop cannot pin the object.
What is actually hard. baileys wants net/tls for its WebSocket client and workerd has neither. The replacement is a fetch() upgrade, which means calling accept() yourself, emitting open exactly once, numeric error codes, binaryType = 'arraybuffer', and no AbortSignal on the upgrade. Each of those is documented in the patch header, because getting one wrong gives you a socket that opens and then dies silently.
What you get: WhatsApp Web-style UI, REST API, WebSocket event stream, token-scoped sending (full / send / embed with per-token chat allowlists and daily caps), media fetched on demand instead of stored, a Google Sheets drainer via Apps Script, credential export/import, and an MCP endpoint so an agent can read chats and send messages without a DB or an extra Durable Object.
Two things I would flag rather than hide: it is a ~9k-line TypeScript project written with heavy AI assistance (architecture and tests reviewed by me), and syncFullHistory: false means a chat with no traffic since you linked the device never appears in the list.
Happy to answer anything about the workerd socket, the DO cost model, or why the message parser has to unwrap ephemeralMessage / viewOnceMessageV2 / documentWithCaptionMessage before it can tell whether a message is even displayable.