Time
Overview
Section titled “Overview”The Time trigger starts a run at fixed times, for example every weekday at 7 a.m. or every five minutes. The run gets only the point in time from the trigger ({{Trigger.Response.Results.TriggeredAt}}); all other data comes from InitialData or from the actions, for example an HTTP request.
- Times are in the PC’s time zone.
- A schedule fires only while RUNOS is running. Times when RUNOS was closed are not made up.
- If a run takes longer than the gap to the next time, the next run still starts on time. Runs can overlap.
Structure
Section titled “Structure”"Trigger": { "Type": "Time", "Name": "Weekdays7am", "Parameters": { "CronExpression": "0 0 7 ? * MON-FRI", "RepeatCount": 0 }}| Parameter | Default | Meaning |
|---|---|---|
CronExpression |
0/30 * * * * ? |
When to fire. Default: every 30 seconds. |
RepeatCount |
0 |
The schedule stops after this many runs. 0 = unlimited. |
Cron expressions
Section titled “Cron expressions”RUNOS uses cron expressions in Quartz format with seconds first, 6 or 7 fields:
second minute hour day-of-month month day-of-week [year]| Character | Meaning | Example |
|---|---|---|
* |
every value | * in the hour field = every hour |
? |
no specific value; exactly one of day-of-month and day-of-week must be ? |
? * MON |
a/b |
from a every b |
0/15 in seconds = every 15 s |
a-b |
range | MON-FRI, 8-17 |
a,b |
list | MON,WED,FRI |
L |
last day of the month | L in day-of-month |
Days: SUN MON TUE WED THU FRI SAT (or 1–7, Sunday = 1). Months: JAN–DEC or 1–12. The File trigger uses the same expressions to decide how often it checks its folder.
Form in the editor
Section titled “Form in the editor”In the diagram of the workflow editor the trigger has a form with Start (CronExpression) and Stop after (RepeatCount). The schedule is picked instead of typed: Every … seconds, Every … minutes, Every hour (at minute …), Every day, Monday to Friday, On chosen weekdays (click the days) or Once a month (day 1–31 or the last day), each with a time. The cron expression it makes is shown below. For anything else choose Custom (cron expression) and type the expression; an expression the picker cannot show (e.g. 0 0 8-17 ? * MON-FRI) opens that way by itself. Parameters the form does not know are listed under Other parameters.
Example
Section titled “Example”| Expression | When |
|---|---|
0/30 * * * * ? |
every 30 seconds |
0 0/5 * * * ? |
every 5 minutes |
0 0 * * * ? |
every full hour |
0 0 7 * * ? |
daily at 7:00 |
0 0 7 ? * MON-FRI |
weekdays at 7:00 |
0 30 17 ? * FRI |
Fridays at 17:30 |
0 0 8-17 ? * MON-FRI |
weekdays hourly from 8 to 17 |
0 0 6 1 * ? |
on the 1st of every month at 6:00 |
0 0 22 L * ? |
on the last day of every month at 22:00 |
Weekdays at 7:00, fetch a list of open orders and send a mail if there are any:
{ "Name": "Open orders", "Autostart": true, "Trigger": { "Type": "Time", "Name": "Morning", "Parameters": { "CronExpression": "0 0 7 ? * MON-FRI" } }, "Actions": [ { "Type": "HttpRequest", "Name": "Query", "Parameters": { "Url": "/orders?status=open", "Connector": "Shop" } }, { "Type": "If", "Name": "AnyOpen", "Parameters": { "Condition": "{{Query.Response.Body.items.count}} > 0", "Do": [ { "Type": "SMTP", "Name": "Notify", "Parameters": { "To": "sales@example.com", "Subject": "Open orders: {{Query.Response.Body.items.count}}", "Body": "…" } } ] } } ]}