Schedules
Schedules turn a bot from a chat responder into a worker that acts at the right time.
Use real cron expressions
HiveLang schedules use five-field cron expressions. Give every schedule a stable name so Bothive can sync and update it safely.
schedule DailyCheck at "0 9 * * *" timezone "UTC" {
say "Running today's check."
}Common examples
CronMeaning
0 9 * * *Every day at 09:000 9 * * 1-5Weekdays at 09:00*/15 * * * *Every 15 minutes0 12 1 * *First day of every month at noonPattern: scheduled research with memory
bot DailyDigest {
description: "Sends a daily research digest"
capabilities {
web.search
ai.generate
general.respond
}
schedule DailyBrief at "0 8 * * 1-5" timezone "Africa/Lagos" {
seen = recall "seen_items"
results = retry call web.search with { query: "latest AI agent platform news" }
with backoff exponential
max attempts 3
fallback {
say "I could not fetch today's research. I will try again on the next run."
}
brief = call ai.generate with {
prompt: f"Summarize only new useful updates. Already seen: {seen}. Results: {results.summary}"
}
remember "seen_items" as brief
say brief
}
on user.message {
say "I run every weekday at 8:00 Africa/Lagos."
}
}Safety rule
Scheduled bots should be conservative with irreversible actions. Draft, notify, or request approval before sending emails, publishing posts, creating events, charging money, or mutating customer records.