Telegram
Send yourself a Telegram message when a rule fires, with the chat ID sealed so it never appears on Arkiv.
The Telegram action sends a message from the OpenTrigger bot. Rules are public, so your chat ID never goes in a rule as is: it is sealed (encrypted) to one worker's key, and only that worker can open it.
Find a worker that can send Telegram
const workers = await triggers.listWorkers()
const tg = workers.find((w) => w.online && w.actions.includes('telegram'))Only a worker started with a bot token lists telegram. Its heartbeat carries sealKey, the public
key you seal to.
Get your chat code
Open the bot in Telegram and tap Start. The public worker's bot is
@arku678_bot; it replies with your chat code, a number such as 123456789.
Seal it
import { sealForWorker } from 'arkiv-triggers'
const chat = sealForWorker(chatCode, tg.sealKey) // "sealed:v1:…"Seal on the user's device (the dashboard does it in the browser). Store the sealed text; drop the plain code.
Create the rule
await triggers.createRule({
name: 'Lease reminder',
trigger: { on: 'expire', target: leaseKey, offset: 1800n },
action: 'telegram',
message: '⏰ {rule}: {entity} expires at {time}',
chat,
worker: tg.worker, // only this worker can open the seal
})When it fires, the receipt's result.messageId is Telegram's message ID.
Why the rule names the worker
The seal is X25519 + XChaCha20-Poly1305 to one worker's key. A rule left as worker: 'any' could be
claimed by a worker that cannot open it, and that worker would record a failure. Name the worker you sealed to.
validateRule refuses a Telegram rule whose chat is not sealed, so a plain chat ID cannot reach
Arkiv by mistake. To run your own Telegram worker, create a bot with BotFather and start your worker
with TG_TOKEN (see Run a worker).