Documentation menu

Schedules

For many scenarios it is useful to trigger activity on a regular schedule: a nightly import, a weekly report, a reminder on the first working day of the month. In Panaptic you do this by scheduling code.

A schedule holds a small piece of code and a timing rule. The timing rule can be a repeating pattern (every weekday at 7am, say), a calendar recurrence rule, or a single date and time. Each schedule has a timezone, so a 7am schedule stays at 7am through daylight-saving changes. Runs can be at most every fifteen minutes.

The code usually does one thing: start a Task. Starting a Task on a schedule creates a new Task Run, which can be assigned to a user or group to act on, or left to complete automatically. The Task’s own settings decide who each new run is assigned to. The scheduled code runs as a chosen user, so it has that user’s permissions and no more.

Panaptic keeps the recent run history of each schedule, and pauses a schedule that keeps failing, so a broken schedule cannot run indefinitely.

What a schedule can do

Most schedules do one of these things:

You want toThe schedule
Start a Task at a set timeStarts the Task for you - for example, every Monday at 9am.
Check something and act only if neededLooks at a connection, such as a mailbox or a payment service, and starts a Task only when there is something to do.
Deal with new items as they arriveStarts a Task for each new email, order or record since it last ran.
Run a code functionRuns the function on a timer - for example, a nightly tidy-up of a data space.

Keep each schedule to one small job. If there is real work to do, put it in a Task or a code function and have the schedule start it. Run a new schedule once by hand to check it before leaving it to run on its own.

You can create a schedule by describing it to the agent:

Every weekday at 7am Melbourne time, start the 'Daily Orders Review' task.

From your main user session, you can launch the ‘Scheduled Code’ app to see your schedules, their timing, and their recent runs.