import{_ as t,o as a,c as s,ag as n}from"./chunks/framework.CAXxHpAX.js";const p=JSON.parse('{"title":"Scheduled Tasks","description":"","frontmatter":{},"headers":[],"relativePath":"getting-started/schedule.md","filePath":"getting-started/schedule.md","lastUpdated":1774459922000}'),i={name:"getting-started/schedule.md"};function o(r,e,d,l,h,c){return a(),s("div",null,[...e[0]||(e[0]=[n(`
Scheduled Tasks allow you to automate recurring bot actions using cron expressions. This is useful for sending periodic reports, checking external data, performing maintenance, or triggering any routine task without manual intervention.
A Schedule is a cron-triggered rule bound to a specific bot. When a schedule fires, it sends a command to the agent, which executes it using its available tools, skills, and context. The bot can then deliver results to any connected channel.
| Field | Description |
|---|---|
| Name | A display name for the task (e.g., "Morning News Summary"). |
| Description | A brief explanation of what the task does. |
| Pattern | A cron expression that defines when the task runs (e.g., 0 9 * * * for daily at 9:00 AM). |
| Command | The natural-language instruction sent to the agent when the schedule triggers (e.g., "Summarize today's top tech news and send it to the Telegram channel"). |
| Enabled | Whether the schedule is currently active. |
| Max Calls | Optional limit on the total number of executions. Leave empty for unlimited. |
| Current Calls | The number of times this schedule has already fired. |
The pattern field uses standard cron syntax with five fields. It is evaluated in the server's configured timezone. By default, Memoh uses UTC, and you can change it with the top-level timezone config value.
┌───────────── minute (0–59)
│ ┌───────────── hour (0–23)
│ │ ┌───────────── day of month (1–31)
│ │ │ ┌───────────── month (1–12)
│ │ │ │ ┌───────────── day of week (0–6, Sun=0)
│ │ │ │ │
* * * * *Common examples:
| Pattern | Meaning |
|---|---|
0 9 * * * | Every day at 9:00 AM |
*/30 * * * * | Every 30 minutes |
0 0 * * 1 | Every Monday at midnight |
0 8,20 * * * | Every day at 8:00 AM and 8:00 PM |
0 0 1 * * | First day of every month at midnight |
Schedules are primarily created in two ways:
The bot itself has access to a schedule tool. You can ask the bot to create a schedule in natural language:
"Create a schedule called 'Daily Digest' that runs every day at 8 AM and sends me a summary of my unread emails."
The bot will translate this into a cron expression and register the schedule automatically.
You can also create schedules programmatically using the REST API:
POST /api/bots/{bot_id}/schedule{
"name": "Daily Digest",
"description": "Summarize unread emails every morning",
"pattern": "0 8 * * *",
"command": "Summarize my unread emails and send the result to Telegram.",
"enabled": true,
"max_calls": null
}When a schedule fires:
current_calls counter is incremented.max_calls is set and reached, the schedule is automatically disabled.command along with the schedule context.| Feature | Schedule | Heartbeat |
|---|---|---|
| Trigger | Cron expression (flexible timing) | Fixed interval (minutes) |
| Command | Custom natural-language instruction | Generic "routine check" prompt |
| Max Calls | Optional execution limit | Unlimited |
| Use Case | Specific recurring tasks | Periodic autonomous thinking |
Both features complement each other: use Heartbeat for general-purpose periodic activity and Schedule for precise, task-oriented automation.
`,35)])])}const g=t(i,[["render",o]]);export{p as __pageData,g as default};