Wake an agent with a message
Four sources wake a sleeping VM for work: email, Telegram, a schedule and an HTTP request. The VM wakes, the work starts, and an agent you start in the VM answers the message.
Before you start
Section titled “Before you start”- A VM. Create one as shown in From your terminal, and keep its id in
VM. - Your API key in
SI_API_KEY, for step 4. - A Telegram account and a bot token from @BotFather, for step 2.
1. Email
Section titled “1. Email”VM=wake-examplesi create --name "$VM"si svm inbox enable "$VM"si svm inbox "$VM"address: 0zs0pshr3x@slashinfra.devenabled: yeswebhook: -Send a mail from your mail app to the address. The VM wakes, and the mail is saved on its disk. Read it inside the VM:
si exec "$VM" -- inbox ls --unreadEvery email wakes the VM. An enabled inbox with no sender rule accepts mail from anyone. Limit the senders in a profile, or run si svm inbox disable "$VM" when you do not need it.
2. Telegram
Section titled “2. Telegram”Connect the bot. Use a file for the token, so it does not appear in your shell history:
si svm inbox telegram "$VM" connect --token-file ~/.telegram-tokenbot: @build_1_botpair code: k3m9q2x7send /start k3m9q2x7 to the bot within ten minutesSend /start k3m9q2x7 to the bot in Telegram. The code is single use. Only paired users reach the inbox.
Let the VM sleep: leave it with nothing running for at least 60 seconds. Then send the bot a message. The message wakes the VM and lands in its inbox.
Start an agent in the VM to answer it. The agent replies with inbox reply, which works only for Telegram messages:
si agent run "$VM" --agent claude --cwd /home/user -- 'Answer the unread Telegram message with inbox reply.'3. Schedule
Section titled “3. Schedule”si svm schedule add "$VM" --name nightly --cron '0 3 * * *' --tz Europe/Berlin -- 'hc run claude "Read the inbox and answer what needs an answer."'nightlynext fire: 2026-11-14 02:00:00ZA due schedule wakes the VM and starts within about 90 seconds. A cron job inside the VM cannot wake it, so use a schedule for work at a set time.
4. HTTP
Section titled “4. HTTP”An HTTP request to the VM wakes it and runs the command in the request:
curl -sS -i -H "Authorization: Bearer $SI_API_KEY" --data-binary 'inbox ls --unread' "https://$VM.slashinfra.dev/bin/bash"X-Exit-Code: 0...Check X-Exit-Code. An HTTP 200 alone does not mean the command succeeded.
Check it works
Section titled “Check it works”You should now see the agent’s reply in your Telegram chat. The VM had nothing to do for a minute before your message, so it was asleep when the message arrived.
If it doesn’t work
Section titled “If it doesn’t work”| Symptom | Cause | Fix |
|---|---|---|
The bot connect command answers inbox_disabled |
The inbox is off | Run si svm inbox enable "$VM". |
The bot gives no answer to /start |
The pairing code expired after ten minutes | Make a new code with si svm inbox telegram "$VM" pair. |
| Mail never arrives | The inbox is off, so the mail is rejected | Run si svm inbox "$VM" and check that enabled says yes. |
Scroll horizontally to see all columns.
Clean up
Section titled “Clean up”Remove the bot and its webhook with si svm inbox telegram "$VM" disconnect. Then remove the schedule with si svm schedule rm "$VM" <schedule-id>, using the id that si svm schedule ls shows. Messages already saved stay on the VM until you delete it.
- Email: addresses, plus tags and the inbox limits.
- Schedules: commands and messages at a cron time.
- Sleep and wake: what keeps a VM awake and what wakes it.