Post

Icon Cron UI Visual Guide

Visual guide for the updated cron expression builder UI with seconds support and six-field cron format

Cron UI Visual Guide

Cron Dialog UI Changes - Visual Guide

New UI Structure

The cron expression builder form now has the following order:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
┌─────────────────────────────────────────────────┐
│  Schedule                                       │
│                                                 │
│  ● Every N seconds          [NEW - FIRST]      │
│    └─ Seconds: [5____]                          │
│                                                 │
│  ○ Every N minutes                              │
│    └─ Minutes: [5____]                          │
│                                                 │
│  ○ Every N hours                                │
│    └─ Hours: [1____]  Minute: [0____]          │
│                                                 │
│  ○ Daily at time                                │
│    └─ Hour: [0____]  Minute: [0____]           │
│       Second: [0____]  [NEW]                    │
│                                                 │
│  ○ Weekly on days                               │
│    └─ [☐Sun ☐Mon ☐Tue ☐Wed ☐Thu ☐Fri ☐Sat]    │
│       Hour: [0____]  Minute: [0____]           │
│       Second: [0____]  [NEW]                    │
│                                                 │
│  ○ Monthly on day                               │
│    └─ Day: [1____]  Hour: [0____]              │
│       Minute: [0____]  Second: [0____]  [NEW]  │
│                                                 │
│  ○ Custom cron expression                      │
│    └─ [_______________________________]         │
│                                                 │
│  Generated cron: */5 * * * * *                  │
└─────────────────────────────────────────────────┘

Key Changes

1. New “Every N seconds” Option

  • Position: First option (above minutes)
  • Default: 5 seconds
  • Expression: */5 * * * * *
  • Default mode: This is now the default selection

2. Seconds Fields Added

All time-based modes now include a seconds field:

  • Daily: Hour, Minute, Second
  • Weekly: Hour, Minute, Second
  • Monthly: Day, Hour, Minute, Second

3. Expression Format

The generated expressions now use 6 fields (with seconds):

ModeOld Format (5-field)New Format (6-field)
Every 5 secondsN/A*/5 * * * * *
Every 5 minutes*/5 * * * *0 */5 * * * *
Every 2 hours0 */2 * * *0 0 */2 * * *
Daily at 10:15:3015 10 * * *30 15 10 * * *
Weekly Sun 12:00:300 12 * * 030 0 12 * * 0
Monthly 15th 09:45:2045 9 15 * *20 45 9 15 * *

User Experience Flow

Creating a New Cron Job (Default)

  1. User creates a new Cron Timer node
  2. Opens the dialog
  3. Sees “Every N seconds” pre-selected with “5”
  4. Generated expression: */5 * * * * *
  5. Executes every 5 seconds

Upgrading Existing Cron Jobs

  1. User opens existing cron job with old 5-field expression
  2. Dialog automatically parses and converts to appropriate mode
  3. Legacy expressions like */5 * * * * are recognized as “Every 5 minutes”
  4. User can add seconds precision by switching modes or using custom

Fine-tuning Time-based Schedules

  1. User selects “Daily at time”
  2. Sets Hour: 14, Minute: 30, Second: 15
  3. Expression: 15 30 14 * * *
  4. Executes daily at exactly 14:30:15

Backward Compatibility

✅ Old 5-field expressions continue to work:

  • */5 * * * * → Interpreted as every 5 minutes at second 0
  • 0 9 * * 1 → Interpreted as Monday 09:00:00

✅ Expression parsing handles both formats automatically

Default Behavior

ScenarioDefault ExpressionExecutes
New cron job*/5 * * * * *Every 5 seconds
Blank expression*/5 * * * * *Every 5 seconds

Common Use Cases

High-Frequency Monitoring

1
2
3
4
Mode: Every N seconds
Seconds: 1
Expression: */1 * * * * *
Result: Executes every second (max frequency)

Regular Sensor Polling

1
2
3
4
Mode: Every N seconds
Seconds: 10
Expression: */10 * * * * *
Result: Executes every 10 seconds

Precise Daily Task

1
2
3
4
5
6
Mode: Daily at time
Hour: 3
Minute: 30
Second: 0
Expression: 0 30 3 * * *
Result: Executes at 3:30:00 AM daily

Weekly Backup with Offset

1
2
3
4
5
6
7
Mode: Weekly on days
Days: Sunday selected
Hour: 2
Minute: 0
Second: 30
Expression: 30 0 2 * * 0
Result: Executes at 2:00:30 AM every Sunday

Field Constraints

FieldRangeDescription
Second0-59Seconds within the minute
Minute0-59Minutes within the hour
Hour0-23Hour of the day (24-hour)
Day1-31Day of the month
Month1-12Month of the year
Day of Week0-6Sunday (0) through Saturday (6)

Custom Expression Format

For advanced users, custom 6-field cron expressions are supported:

1
2
3
4
5
6
7
8
[second] [minute] [hour] [day] [month] [day_of_week]

Examples:
*/30 * * * * *           - Every 30 seconds
0,30 * * * * *           - At 0 and 30 seconds each minute
15 0,30 * * * *          - At 15 seconds past 0 and 30 minutes
0 0 12 * * 1-5           - 12:00:00 PM on weekdays
*/5 0-30 9-17 * * 1-5    - Every 5 seconds, minutes 0-30, hours 9 AM-5 PM, weekdays

UI Screenshots

Default View (Every N seconds)

Cron Dialog Default Default view showing “Every N seconds” selected with 5 seconds

Daily Schedule

Cron Dialog Daily Daily schedule with seconds precision

Custom Expression

Cron Dialog Custom Custom 6-field cron expression

Tips for Users

  1. Start simple: Use “Every N seconds” for most monitoring tasks
  2. Be precise: Add seconds to daily/weekly tasks for exact timing
  3. Test first: Use a test node to verify your cron timing
  4. Check logs: Monitor execution logs to confirm schedule
  5. Use custom: Advanced patterns require custom expression mode

Summary

The updated cron UI provides:

  • ✅ Second-level precision for all scheduling modes
  • ✅ Intuitive “Every N seconds” as default
  • ✅ Full backward compatibility with existing cron jobs
  • ✅ Clear visual feedback with generated expression display
  • ✅ Support for both simple and complex scheduling needs

This makes Krill’s scheduler one of the most flexible and user-friendly in the IoT automation space.

This post is licensed under CC BY 4.0 by the author.