Universal relay
From any source, through a recipe, to any sink
A recipe is data: a source, steps and a sink, run by the workflow engine, with a receipt for every hop.
The first recipe: a mail reply, in your language, on Telegram
postmaster
A signed
reply.receivedevent arrives. The reply is fetched once, quoted history is dropped and a 600-character excerpt is cut. Replies that failed SPF, DKIM or DMARC are not relayed.x-talk
The excerpt is translated into the language the recipient listens in, with x-talk's signed receipt.
Telegram
Sent to the chat the person started with the bot. Deduped on the engine's idempotency key; the stored row holds Telegram's message id and digests, never the text.
Telegram, the polite way
- A bot cannot message a person first. A tenant admin makes a one-time link for a recipient, good for 7 days; the person's
/startbinds their chat, with their language. /stop, or blocking the bot, unbinds it.- Deleting a recipient voids their links and bindings, so a recreated id never reaches the previous person's chat.
- A lost answer (no response, a reset, a 5xx) keeps the send as uncertain: a message is never sent twice. Only a 4xx frees it for a retry.
The workflow engine
What to send, on which channel, when and how often, and what to do when a channel fails.
Safe to run again
A trigger is answered at once (202); the worker does the rest. Runs are unique per trigger and recipient, steps move only by guarded transitions, and each attempt's idempotency key is fixed when it is made.
The channel ladder
Sinks are tried in order. A recipe decides from the error kind (try the next sink, wait, give up), never from the provider.
Sealed facts
Accepted, dispatched, delivered, read, acknowledged, failed, expired, withdrawn: each sealed on the tenant's chain in the same transaction as the change.
Webhooks out
A per-tenant outbox in order, at least once, with back-off, a dead-letter range and replay. Events carry ids, states and hashes, never content.
Providers
One adapter per external service, each with a fake, so everything is built and proved without an account or spend.
| Provider | Sends | Inbound | Live use needs |
|---|---|---|---|
| Telegram Bot API | text to chats that started the bot | webhook with a secret token; /start, /stop, text, blocks | a bot (set up) |
| X API v2 | posts (weighted 280 characters, no @mentions) | — | a paid tier (not yet) |
| WhatsApp Business Platform | approved templates; free text only in the 24-hour window | handshake, signed webhooks, messages, STOP, statuses | business verification, a number, templates (not yet) |
| x-talk | translations with x-talk's signed receipt | — | an x-talk key |
Rules every provider keeps
- Official platforms only. Unofficial ids such as
whatsapp-personal,whatsapp-weborx-scrapeare refused. Personal WhatsApp is never a server sink: on a phone, a person shares one message at a time through the share sheet. - Secrets never print. Tokens are kept as secrets; errors are redacted; fakes record
[secret]. - Retries only when safe. A rate limit waits for its Retry-After. A send is never retried after a timeout.
- One error vocabulary:
auth,rate-limited,invalid,recipient-unreachable,policy,unavailable,timeout,unexpected. - Receipts carry digests. A delivery has the provider's message id and a SHA-256 of the text, never the text.