This is the documentation for version 0.22.0. Read this page for the latest version, 0.26.0.
Documentation · version 0.22.0
Tasks and schedules
A task is a job a bot runs on its own, on a schedule or when something happens, and reports back in the bot's chat.
Add a task
There is no add button: you ask the bot in its chat.
- Open the bot's chat.
- Say what to do and when, for example "check the news every hour" or "every weekday at 8:00, summarize my inbox".
- If the bot asks to confirm the change, approve it. Its reply says what the task does and when it runs.
- The bot can also change, switch off, move, or delete its tasks when you ask.
- A task doesn't see the chat that made it, so give the bot everything the task needs, such as where to save results.
- For quick one-off work, just ask in the chat; use tasks for work that repeats or takes a long time.
See a bot's tasks
- Open the bot's chat.
- Choose Bot tasks in the chat header (on a phone, it is in the ⋯ menu).
Each task shows its status, next run, run count, and Last result. Its History lists the last 50 runs, what started each, and whether it Completed, Failed, or was Skipped.
Edit a task
- In Bot tasks, choose Edit task on the task.
- Change the Name, Instructions, Model, Repeat, or limits.
- Choose Save.
Changes apply from the next run; a run under way isn't stopped.
Pause, run, or delete a task
- Run now runs it at once. Stop ends a run under way.
- Turn off in the task's More actions menu pauses it: it never runs until you Turn on again. Run now on a paused task turns it back on. On a phone, swipe the task sideways for the same choices.
- Delete task in the same menu removes the task and its history after you confirm. The bot keeps its files.
Choose when a task runs
In Edit task, Repeat offers:
- Run once: one run.
- On an interval: Every so many seconds, minutes, hours, days, or weeks (5 seconds to 365 days).
- Every day at a time: once a day at a 24-hour Time in your Time zone (Settings → Data). If the app was closed at that time, it runs once when the app opens; switch off Run a missed run when the app opens to wait for the next day instead.
- Continuously: runs back to back until Stop when is met (a plain-words goal), Maximum runs is reached, or Stop at (UTC) passes. Give it an end; it can spend a lot.
Intervals pace spending better than continuous runs. Every task also stops at its provider's daily spend limit.
Start a task when something happens
Instead of a time, Repeat can wait for an event. Each one starts a run with what arrived attached:
- When a message arrives on Telegram, Discord, Slack, WhatsApp, or email that the bot already answers, optionally only messages containing some words.
- When another bot messages this bot.
- When new email arrives in a linked mail account (checked every 2 minutes).
- When a feed has new items (RSS, Atom, or JSON; read every 15 minutes).
- When files arrive in a folder of the bot's workspace.
- When a website's status changes: it goes down, comes back, turns slow, or its certificate nears expiry (checked every 3 minutes).
- When its webhook is called: needs a Bot Legger server set up to receive webhooks. Keep its Webhook address secret, or set a Signing secret.
Only new things count: what already exists when you set the task up is ignored. Text that starts a run is treated as information, not as orders.
Get reports and notifications
- Each run's result appears in the bot's chat as a task report.
- To hear only when it matters, say so in the instructions ("tell me only when the price drops below $50"). Runs with nothing new post nothing.
- With the app in the background, a report can raise a notification (Notify when a bot finishes in Settings → General). A bot can also send you a notification when you ask it to.
- After five failed runs in a row you get a warning and a notification. If it keeps failing, the task stops, says it needs attention with the reason, and offers Retry.
Keep tasks running
Tasks run only while Bot Legger is running on the device that holds them.
- On a computer, closing the window keeps the app running in the menu bar or system tray (Keep running when the window is closed in Settings → General). Quitting stops tasks until you open it again; then they pick up where they were. Open at login starts it for you.
- Keep the device awake while Bot Legger is open stops the computer sleeping; a closed laptop lid still sleeps.
- On a phone, tasks run only while the app is on screen; the phone pauses it soon after you leave. Keeping it awake keeps the screen on and uses battery. For tasks that run around the clock, use a cloud computer, which keeps running when your devices are off.