Skip to the page
DataMosaic

Docs · Automating

Triggers and schedules

Running a Check unattended — the schedule kinds, how firing actually works, and what a missed slot does.

A trigger is a schedule attached to a Check, plus what to do with the result.

Creating, editing, running and deleting one is an admin's. A trigger is a standing instruction to move data out of Mosaic, not an edit to a Check. Viewers and editors can see the list.

#The four schedule kinds

RepeatsFields
Every N minutesMinutes, at least 1
DailyHour and minute — minutes in five-minute steps
WeeklyA time, and which days
MonthlyA time, and a day of the month

A new trigger starts as Daily at 02:00, weekdays only, and Inactive until you switch it on.

For monthly: "31 fires on the last day of shorter months rather than skipping them." A month-end reconciliation set to 31 runs on the 28th of February, which is almost certainly what you meant.

#Which clock it uses

The workspace's time zone, never the server's. The same setting decides what TODAY means inside a query and which day a run counts towards on the Overview.

Change the time zone and every schedule is re-booked in the new one as soon as you save.

#How firing actually works

Mosaic checks every half minute, and a schedule fires on the first check past its time. That is the whole mechanism, and its consequences are worth knowing.

A missed slot fires once, not once per slot. A machine that was off for three days does not wake up and run seventy-two times. It runs once, and the run is marked late by N minutes.

One unfinished run per trigger, ever. If a run overruns its next slot, the next slot is skipped rather than queued behind it. Long runs cannot pile up.

The next run is booked from now, not from the slot that was missed.

A failed run is never retried automatically. It waits for its next slot. This is deliberate — a Check that failed because a source was down will fail again in thirty seconds, and again, and the schedule is the natural backoff.

#Whether Mosaic has to be running

This is the question people get wrong, and the interface answers it directly.

A desktop installation says:

This Mosaic runs only while it is open, so this schedule fires only while this window is. A missed slot fires once when Mosaic next starts, and the run is marked late.

Installed as a service, it says:

Installed as a service: this schedule fires whether or not Mosaic is open, and survives a reboot.

If a schedule matters, install the service. See Run Mosaic.

#The editor

A trigger opens the way a workflow does. Along the top are its name, Editor and Executions, the Active switch, Save, a ⋮ menu holding Delete trigger, and Ask the agent.

Active is saved as soon as you switch it, as a workflow's is. Any other change you have on screen waits for Save.

The Editor is a workflow's canvas, with the same nodes, wires, tools and keys. A trigger is drawn on it as:

  1. Schedule, showing the schedule in words.
  2. Check, the Check this trigger runs.
  3. One node per output (Keep, File, Email or Notification), wired one to the next in the order they run.
  4. A + after the last output.

After a run, each node shows how it went (a tick, or a red mark you can hover to read why it failed), and each wire says what went along it: one item from the schedule, then the Check's rows.

Everything you do on a workflow's canvas works here:

ToDo
Move a stepDrag it. Where you leave it is kept when you Save.
Open a stepDouble-press it, or select it and press Enter.
Add an outputAdd an output in the toolbar, the + after the last output, the + on a selected wire, or Tab with a step selected.
Copy an outputSelect it and press Ctrl+D. The copy runs straight after it.
Switch an output offThe eye among its tools, which appear when you hover it.
Remove an outputThe bin among its tools, or select it and press Delete.
Run the triggerRun now at the foot, or the play button among a step's tools. Either runs the whole trigger.
Leave a noteThe note button in the toolbar.
Straighten the canvasTidy up in the toolbar.
Undo or redoThe toolbar's arrows, Ctrl+Z and Ctrl+Y.

What differs from a workflow is what a trigger is: a schedule, one Check, then its outputs in order.

  • The Schedule and the Check are always there. They have no bin and no eye, and Delete passes them by.
  • The wires follow the order. Drawing a wire from a step into an output makes that output run straight after the step; from the Check, it runs first. A wire into the Schedule or the Check is refused, because an output can only run after them. A wire cannot be deleted on its own: remove the output instead.
  • An output added on a wire runs where the wire was, between the two steps it joined.

#A step, open

A step opens in the window a workflow's node opens in: Back to canvas, Save and Run now across the top, then three panes.

StepInputParametersSettingsOutput
Schedulenone (it starts the trigger)When it repeats, and at what timeActiveWhen it last fired, what started it, how late it was, and when it fires next
CheckWhat the schedule handed onA value for each of the Check's parametersWhat a fire always doesThe Check's rows from the last run, and Open this run
OutputThe Check's rows from the last runThe destination: folder, addresses, webhook…Active, Run earlier / Run later, Remove this outputDone or Failed, in the output's own words

The panes list up to 100 rows as a table, a schema or JSON, with the full count beside them. The rows come from the run the trigger recorded. A run's rows are kept for a week; after that its counts stay in the Check's history and the panes say the rows are no longer kept.

Parameter values. Each parameter of the Check can take a value for this trigger alone. Leave the box empty and the parameter runs with its own default, which shows greyed out in the box. A mandatory parameter with no default needs a value here, or every fire is refused.

#How outputs run

Outputs run in the order their wires go, wherever they sit on the canvas. The Check runs once however many outputs there are, and an output that fails does not stop the ones after it.

Run now saves first and then takes exactly the path the scheduler takes — so what you see is what will happen at 02:00, not an approximation of it.

#When the Check fails

The run is recorded first, before any output block runs, because recording is what computes what moved — and what moved decides whether a block has anything to say.

A trigger run is ok only when no block failed and no error-severity Rule was breached. A breached Rule fails the trigger run even when every output delivered successfully.

The error recorded is the breached Rules in their own words, followed by any block that failed, joined with ·.

Whatever happens, the next run is booked. A failing trigger never spins.

#Executions

Every fire is kept, as a workflow's runs are, newest first: whether it succeeded, when it fired, what started it (Schedule, or By hand and who pressed Run now), and how long it took. All, Failed and Succeeded filter the list, which refreshes on its own every few seconds.

Choosing a fire draws the trigger as that fire went through it, with each step's result on its node. A failed fire shows its error above the canvas, and late fires say late by N minutes. Opening a step shows what it was given and what it did on that fire; its settings are shown as they are now, because a fire keeps what each step did, not how it was set.

Open this run opens the Check's run the fire recorded. Delete this run forgets the fire; the Check's run stays in the Check's history.

At most 200 fires of one trigger are kept, and never more than your plan keeps runs of a Check. Deleting a trigger deletes its fires with it.

#A licence that has lapsed

Schedules stop firing. That is the only thing lapsing stops, along with publishing something new. Checks still run by hand, results are still readable, and the log says so:

3 schedule(s) were due and did not fire: … Checks can still be run by hand.