Schedules
A schedule runs a task automatically at set times, on an agent, an agent group or any free agent, with the inputs you choose. To start a task when a file or a mail arrives, another system calls Botream or someone presses a key, use a trigger.
How scheduling works
Schedules are kept in the Botream database and fired by the server itself; there is no extra component to install. Each schedule has a cron time, and the server starts a run when that time comes:
- Times use the server's time zone.
- A schedule runs the task's current public version. Push a task before you schedule it; tasks that were never pushed cannot be chosen. See Versions and workspaces.
- A run is started on behalf of the user who created the schedule, so that user's vault access applies to the credentials the task reads.
- A run is never started twice, even when two servers share one database.
Create a schedule
Open Schedules and click New schedule. Fill in:
| Field | Description |
|---|---|
| Name | For example Morning invoice import. |
| Task | The task to run. Tasks without a public version are disabled. |
| Runs on | Any available agent, an agent group (under Agent groups), or one agent (under Agents). Agents that are offline or not approved are marked. |
| When | The recurrence, built with the options below. |
| INPUTS | Values for the task's inputs, shown when the task declares any. Required inputs without a default must be filled in. |
| If no agent is free at the time | Skip the run (default), or Wait up to 15 min … 24 h for an agent. See Waiting for an agent. |
| Wake the machine (Wake-on-LAN) | Wakes the agent's machine, or the offline machines of the group, when they are offline at the time. Not available for Any available agent. See Waking agent machines. |
| If a run is missed | Skip it or Run once when back (within 24 h). |
| Active | Whether the schedule fires. |
Click Create.
Recurrence options
The When field offers:
| Option | Settings | Example cron |
|---|---|---|
| Every few minutes | every 1, 2, 5, 10, 15, 20 or 30 min | */15 * * * * |
| Every hour | at minute 0–59 | 5 * * * * |
| Every day | at a time | 0 8 * * * |
| Weekdays (Mon–Fri) | at a time | 0 8 * * 1-5 |
| Certain days of the week | days (Mon … Sun) and a time | 30 7 * * 1,3,5 |
| Once a month | day 1–31 and a time | 0 6 1 * * |
| Custom (cron expression) | any 5-field cron expression | 0 8-18/2 * * 1-5 |
A custom expression has five fields: minute hour day-of-month month day-of-week (0 = Sunday). Below the field you see a plain-language description, the expression and the next three run times. An invalid expression is shown in red with the reason.
Tip: Pick the closest preset first: when you switch to Custom (cron expression), the field starts with the preset's expression.
Choosing where it runs
| Runs on | Behaviour |
|---|---|
| An agent | Runs on that agent. If it is offline or busy, the run is skipped, or waits for it (see below). |
| An agent group | Runs on the first free, online and approved member of the group. |
| Any available agent | Runs on the first free, online and approved agent. |
Groups are managed by administrators under Administration → Agents → Groups; see Agents.
Waiting for an agent
The machine that runs a task must be switched on, and its agent connected, at the scheduled time. If no agent can take the run then (the agent is offline, busy, or waits for approval):
- With Skip the run, the run is skipped and the schedule continues at its next time.
- With Wait up to …, the run waits. Last run shows Waiting for an agent and the reason. The server tries again every 15 seconds, and at once when an agent connects or finishes a run, so the run starts as soon as an agent can take it. Last run then says, for example, Run on Robot-1 after waiting 4 min.
- If no agent becomes free in time, the run is skipped with No agent became free within 30 min.
A schedule waits for at most one run: when its next time comes while a run still waits, they count as one run. Switching the schedule off, or changing its task or agent, drops the waiting run. Run now never waits; it starts at once or reports why it could not.
Waking agent machines
With Wake the machine (Wake-on-LAN) on, the server wakes the target machines when they are offline at the scheduled time: the chosen agent's machine, or the offline machines of the chosen group. They can be asleep, hibernating or switched off. Wake-on-LAN packets are sent again every 5 minutes while the run waits.
A woken machine needs a few minutes to start Windows, sign in and connect its agent, so let the run wait: switching this on sets the wait to 30 minutes if it was Skip the run. Unattended robot machines sign in by themselves; see Install an agent for what the machine needs. Administrators can also wake an offline agent by hand from Administration → Agents (row menu → Wake (Wake-on-LAN)).
The schedule list
The Schedules page shows each schedule with:
- Schedule: its name and the task it runs.
- When: the recurrence in words and its cron expression.
- Agent: the agent, the group ((group)) or Any available.
- Next run: for example in 25 min (hover for the exact time), or Paused when the schedule is inactive.
- Last run: Started, Skipped, Failed or Waiting for an agent, and when. Hover it for the reason.
- Active: a switch to enable or disable the schedule.
Use the row buttons to Run now (start the task immediately, even when the schedule is inactive), Edit or Delete a schedule. Deleting a schedule keeps the task and the history of past runs.
Last run results
| Result | Meaning |
|---|---|
| Started | The run started; follow it under Executions. Runs started by a schedule show the schedule's name under Started by. |
| Skipped | The run did not start: no free agent was available (within the wait, if one is set), the chosen agent was offline or busy, or the previous run of this schedule was still going. The schedule tries again at its next time. |
| Waiting for an agent | No agent could take the run at its time; it waits, as set under If no agent is free at the time. |
| Failed | The run could not be started, for example because the task was deleted. |
Last run tells you whether the run started, not how it ended. To see whether the task itself succeeded, open it in Executions.
Missed runs
A run is missed when the server was not running at the scheduled time (it notices runs more than two minutes late):
- Skip it (default): missed runs are ignored; the schedule continues at its next time.
- Run once when back (within 24 h): one run starts when the server is back, if the missed time is less than 24 hours ago.
When the scheduler is not working
If the server cannot reach its database, the Schedules page shows The scheduler is not working. Schedules are kept but do not fire until the scheduler recovers, which it does by itself. Administration → System health shows the scheduler's state and last error; see Monitoring and administration.
Email on failure
Botream can email people when a run started by a schedule fails. An administrator enters comma separated addresses in Email when a scheduled run fails under Notifications, and configures the mail server under Mail (SMTP) in Settings.
The email (subject Scheduled run failed: followed by the task name) gives the schedule, the agent, the start time, the execution number and the error. Runs you start by hand and skipped triggers do not send an email.
Who can use schedules
| Permission | Access |
|---|---|
| Manage schedules (Admin, Developer by default) | The Schedules page and the API: create, change, delete and run schedules. |
| Without it (Runner, User by default) | No access. |
A scheduled run runs on behalf of the user who created the schedule: their vault access applies. See Users and roles.
Creating, changing, deleting and running a schedule now are recorded in the audit log.