Timer
timer · Nodes · Action
Reads or changes a workspace timer session.
Timer#
Reads or changes a workspace timer session.
- Tag:
timer - Input socket:
input - Output socket:
output - Operation fields render against canonical
input, for example{{ input.session_id }}. - The id fields —
session_id, the selector'stimer, and start'stimer— take an id or a template that renders to one. Blank,nullor a template always saves; the node checks the id when it runs. - Every duration is a whole number of seconds.
Timers and sessions#
A timer is a named length the workspace keeps: Email, 1800 seconds. A session is one run of
one, live or finished. Both are rows in ordinary workspace tables — Timers and Timer Sessions —
so the table node reads and charts them like any other data; this node exists for the things a
table cannot do, which is starting a session and moving it through its lifecycle.
A session copies its timer's name into label and its length into length_seconds when it starts.
Renaming or deleting the timer afterwards changes nothing already recorded.
There are two kinds, timer and pomodoro, and one difference between them:
- a pomodoro session ends when it reaches zero. With auto-advance configured, a session in the opposite mode starts in its place.
- a plain timer keeps counting.
statestaysrunning,zero_reached_atis set, andremaining_secondsgoes negative and keeps falling until something stops the session. Nothing auto-stops it, and reaching zero alerts once and only once.
One session per timer, and one pomodoro at a time. Starting Email while Email runs is refused;
starting Email and Deep work together is fine.
Operations#
list_timers#
No fields. Output is the workspace's timers, ordered by name, each {"id", "name", "length_seconds"}.
get_active#
kind:timerorpomodoro.timer: which timer, forkind: timer. Empty, it matches the active session of any timer.
Output is the session, or null when none is active.
start#
One field, timer, tagged on kind so a kind can only carry its own fields:
{"kind": "timer", "timer": "<timer id>"}— starts one of the workspace's timers.{"kind": "pomodoro", "mode": "focus", "length": 1500}—mode(focusorbreak) andlengthare both optional, falling back to the plugin's pomodoro settings and tofocus.
Output is the new session. A blank timer for kind: timer fails the run with timer is required.
A timer that is already running is refused with timer_session_active.
pause, resume, finish, cancel#
Each takes session_id. Leave session_id empty and the node acts on the active session of the
stated kind — and of the stated timer, for a plain one — so a workflow reacting to a timer
event needs no id plumbing. finish additionally takes note, which is stored on the session.
Output is the changed session.
pause folds the stretch counted so far into elapsed_seconds and stops the clock; resume starts
a new stretch. finish and cancel both end the session and keep the row — state: "finished" and
state: "cancelled" respectively — set ended_at, and record overtime_seconds: the time counted
past zero, or 0 when the session was stopped before reaching it.
Session output#
A session is:
id,kind(timer|pomodoro),state(running|paused|finished|cancelled)labelandlength_seconds, copied from the timer at startstarted_at,ended_at(nullwhile the session is still active),resumed_at(the start of the current running stretch,nullwhile paused)elapsed_seconds, counted in stretches before the current onezero_reached_at,overtime_seconds,notedetails, holding what only that kind has:{"kind": "timer", "timer": "<timer id>"}or{"kind": "pomodoro", "mode": "focus"}
Example#
{
"id": "start-deep-work",
"node": {
"timer": {
"operation": {
"op": "start",
"timer": { "kind": "timer", "timer": "{{ input.timer_id }}" }
}
}
},
"position": { "x": 120, "y": 80 }
}
Failure behavior#
- Build and execution fail with
Timers plugin not installedwhen the workspace has not installed Timers. - An id field holding something that is not an id is reported on the saved workflow as
expected ULID session idorexpected ULID timer id; a template that renders to one fails the run with an error naming the field, such assession_id is not usable. timer_session_activewhen the timer already has a session running,timer_not_foundandtimer_session_not_foundfor an unknown id, andtimer_runningwhen a timer with a live session is deleted.timer_session_not_running,timer_session_not_paused, andtimer_session_not_activewhen the operation does not apply to the session's current state.timer_session_changedwhen the session moved on while the operation was being applied.
Inputs
inputRequired
Outputs
output
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
operation | tagged_union | No | |
base_config | record | No | Shared node configuration. failure_mode decides what a failure of this node does to the workflow; leave it at the default stop unless the workflow handles the failure itself on the node's error output (route_to_error) or the node is a rare emergency kill switch (stop_workflow). |