Timers & Scheduled Wakeups
Puts waiting tasks to sleep and wakes them up on schedule or when a deadline expires.
Waiting tasks hang forever if nobody answers an approval, and recurring checks need external cron scripts.
Approvals expire cleanly on SLA deadlines, and monitoring agents wake up reliably on schedule.
What It Does (In Plain English)
Scheduler manages durable timers backed by the queue. It automatically expires unanswered human approval requests after a timeout, wakes continuous monitoring goals every hour or day, and lets agents sleep until a later check time without wasting compute.
Real-World Example
- 1A high-stakes refund waits for approval with a 4-hour SLA.
- 2Scheduler sets a durable timer for 4 hours from now.
- 3Nobody approves in time → Scheduler fires the expiry timer.
- 4Approvals cancels the stale request and notifies the operations inbox.
When Should You Turn It On?
Add when you want approval deadlines, recurring checks, or delayed follow-up waits.
Safety level note: Level 1 · Review — Read-only. Can inspect and answer, never changes outside systems.
How to Add It (workspace.yaml)
kits:
- "@neusym/kit-scheduler@0.1.0"
grants:
contextIssuer: [scheduler]
kitConfigs:
scheduler:
waitTool: trueKits It Works With
Technical Details & Configuration Options (6 settings)
| Package | @neusym/kit-scheduler |
|---|---|
| Provides Ports | scheduler@1timers@1 |
| Requires Ports | queue@1 |
| Optional Ports | tools@1 |
| Publishes Events | signal.resolvedschedule.tick |
| Owned DB Collections | timers |
Configuration Options (kitConfigs.scheduler)
| Setting | Type | Default | Description |
|---|---|---|---|
fireBatchSize | integer | 100 | Due timers one fireDue call takes at most, when the host names no limit. |
leaseMs | integer | 30000 | How long a fireDue call holds a due timer before another call may take it over. |
maxAttempts | integer | 5 | Failed attempts to fire a timer before its job dies; a scheduled timer whose job died gets a new one on a later fireDue, after a wait that doubles with each death in a row (up to 12 in a row, then it stays scheduled). |
retryAfterMs | integer | 1000 | Wait before a timer whose firing failed is tried again. |
waitTool | boolean | false | Registers the scheduler.wait tool (with tools@1 loaded): an agent pauses its own run for a number of seconds, and the run goes on when the timer fires. |
maxWaitSeconds | integer | 604800 | The longest pause scheduler.wait accepts. |