Skip to content

Window

The Window operation keeps a rolling collection of recent numbers and reports one figure over it — the minimum, maximum, mean, sum, or how many samples it is holding. The collection is bounded either by time (everything from the last N seconds) or by count (the last N samples).

A count window of one sample aggregates only the latest sample, and the Editor marks Samples with an info mark when it is set to 1.

Window operation

Inputs

PortTypeRequiredDescription
>AnyNoOptional gate. When closed, the path stops and no sample is recorded.
InInteger or FloatYesThe sample to add. A non-numeric or Nil value fails the Node; its On Error verb resolves the failure.

Outputs

PortTypeDefaultDescription
OutFloatNilThe chosen aggregate over the collection as it stands after this sample was added.

Properties

NameTypeDefaultDescription
Window ModeStackedDataSetTimeHow the collection is bounded.
 Time — SecondsInteger60Keep samples taken within the last N seconds, 1–2147483647.
 Count — SamplesInteger10Keep the last N samples. The upper bound is the broker’s configured sample cap.
AggregationComboMeanMin, Max, Mean, Sum or Count.
On ErrorComboStop this branchPer-op On Error verb (Stop this branch / Continue with the last value / Continue with the fallback). See the Error Handling guide.

State on Reload

Out is preserved across restarts. The collection is not: after a restart the window refills from the next sample onward.


  1. Gate check — if the Gate is connected and closed, the path stops and nothing is recorded.

  2. Read the input — In must carry a number. Anything else fails the Node, and its On Error verb resolves the failure.

  3. Add — the value is appended to the collection with the moment it arrived.

  4. Retire — in Count mode the oldest samples beyond Samples are dropped. In Time mode every sample older than Seconds is dropped. A broker-wide cap then trims whatever remains above it.

  5. Aggregate — the chosen figure is computed over what is left, Out is written as a Float, and the path continues.


Window Mode: Count = 3   Aggregation: Mean

RunInHeldOut
1101010.0
22010, 2015.0
33010, 20, 3020.0
44020, 30, 4030.0

  • Smoothing a noisy sensor — a Mean over the last 60 seconds gives Compare or Hysteresis something steadier to act on than the raw reading.
  • Peak detection — a Max over a rolling window holds the highest value seen recently without keeping a running maximum by hand.
  • Measuring arrival rate — Count over a time window answers “how busy has this been” directly.
  • Totalling over a period — Sum over a time window accumulates without a separate counter to reset.

Window fails when In is unconnected, Nil, or not a number; the Node’s On Error verb resolves the failure.

VerbWhat it does
Stop this branch (default)This Node and its dependents stop; Out keeps its value and reads as a failed update.
Continue with the last valueDependents run on the value Out already holds, not stamped as new; it reads as a failed update.
Continue with the fallbackDependents run on Out’s per-output Fallback, stamped as this run’s value; it reads as a failed update. The Editor refuses a Task where the Fallback is unset.

A rejected sample is not added to the collection.


  • The window bound and the aggregate are fixed at configuration time; neither can be driven from an input port. To report several aggregates over one signal, use one Window per aggregate.
  • Only numbers can be collected.
  • Out is always a Float, including for Count. Feed it through Convert when a downstream port requires an Integer.
  • The collection does not survive a restart, so the first aggregates after one are computed over a partly refilled window.

One host setting bounds Window. It is read at start-up from the host’s configuration file; see the Core configuration reference.

KeyTypeDefaultEffect
core.windowMaxSamplesInteger1000The largest count window a Window node may request.

The value is carried in the operation’s schema as the upper bound of the sample count, so the editor constrains the setting to it and states the accepted range.