Time Window
Aggregates events into time-based or count-based windows.
Buffers the items that reach it during one run and emits them as one batch through out when the buffer reaches max_items or interval_seconds have passed since the first item.
This operator allows processing of streams of data by grouping them into "windows". It buffers incoming payloads and emits them as a batch when the window conditions are met.
Window Types:
- Tumbling: Fixed non-overlapping windows (e.g., every 5 minutes).
- Sliding: Overlapping windows (e.g., last 5 minutes, updated every minute).
- Count: Window of N items.
Use Cases:
- Aggregating sensor readings every minute.
- Batching analytics events before sending to a data warehouse.
- Detecting patterns A -> B within a specific timeframe.
How it works
- The worker wraps the payload as
{ window_items: [payload], window_meta: { start_time, end_time } }(ISO strings) and setsmeta.window{ type, interval, batch_size }fromtype(defaulttumbling),interval_seconds(60) andmax_items(100). - The engine intercepts it and appends that wrapper to an in-memory buffer for this node.
- When the buffer holds
max_itemsentries, orinterval_secondshave passed since the first entry (checked only when an item arrives), the engine sends{ window_items, window_meta: { start_time, end_time, count } }throughout(times in epoch milliseconds) and empties the buffer. - Otherwise nothing continues from the window for that item.
In a workflow
The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.
{
"node_id": "node-batch-events",
"label": "Batch events",
"operator_slug": "flow.window",
"operator_version": "1.0.0",
"config": {
"type": "tumbling",
"interval_seconds": 60,
"max_items": 2
}
}{
"ok": true,
"data": {
"window_items": [
{
"id": 1
}
],
"window_meta": {
"start_time": "2026-11-26T15:00:00.000Z",
"end_time": "2026-11-26T15:00:00.000Z"
}
},
"meta": {
"window": {
"type": "tumbling",
"interval": 60,
"batch_size": 2
}
},
"port": "out"
}Configuration
-
typestring Optional -
interval_secondsinteger Optional -
max_itemsinteger Optional -
Force close window if buffer size reaches this limit.
Its configuration shows the shared execution settings, but this node does not apply retries (retryOnFail, maxTries) yet. continueOnFail is not applied by any node.
Behaviour in the code
What the implementation does with these keys beyond what the schema says.
-
type - Ignored:
slidingbehaves liketumbling. -
interval_seconds - A value of 0 closes the window on every item.
Output ports
out default The window closed by count or time. Each entry of window_items is the worker wrapper, so the original payload is at window_items[i].window_items[0].
{
"window_items": [
{
"window_items": [
{
"id": 1
}
],
"window_meta": {
"start_time": "2026-11-26T15:00:00.000Z",
"end_time": "2026-11-26T15:00:00.000Z"
}
},
{
"window_items": [
{
"id": 2
}
],
"window_meta": {
"start_time": "2026-11-26T15:00:00.150Z",
"end_time": "2026-11-26T15:00:00.150Z"
}
}
],
"window_meta": {
"start_time": 1795705200000,
"end_time": 1795705200150,
"count": 2
}
}error Only when the worker throws unexpectedly.
{
"error": "<message>"
}In expressions
What a later node can read from this node's output with $("Time Window").item.json.<path> (write your node's label instead of Time Window). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through out, from the output shown in Ports.
| Expression | Editor | Worker |
|---|---|---|
$("Time Window").item.json.window_items | ||
$("Time Window").item.json.window_meta | ||
$("Time Window").item.json.window_meta.start_time | ||
$("Time Window").item.json.window_meta.end_time | ||
$("Time Window").item.json.window_meta.count | — |
— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).
Input contract
-
payloadobject Optional
Output contract
-
window_itemsarray<object> Optional -
window_metaobject Optional -
-
start_timestring Optional -
end_timestring Optional
-
Contracts (JSON Schema)
The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.
{
"slug": "flow.window",
"name": "Time Window",
"category": "flow",
"version": "1.0.0",
"description": "Aggregates events into time-based or count-based windows.\n\n This operator allows processing of streams of data by grouping them into \"windows\". It buffers incoming payloads and emits them as a batch when the window conditions are met.\n\n **Window Types:**\n - **Tumbling:** Fixed non-overlapping windows (e.g., every 5 minutes).\n - **Sliding:** Overlapping windows (e.g., last 5 minutes, updated every minute).\n - **Count:** Window of N items.\n\n **Use Cases:**\n - Aggregating sensor readings every minute.\n - Batching analytics events before sending to a data warehouse.\n - Detecting patterns A -> B within a specific timeframe.",
"capabilities": [
"windowing",
"aggregation",
"stream",
"buffer"
],
"config_schema": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"tumbling",
"sliding"
],
"default": "tumbling",
"title": "Window Type"
},
"interval_seconds": {
"type": "integer",
"default": 60,
"title": "Interval (Seconds)"
},
"max_items": {
"type": "integer",
"default": 100,
"title": "Max Items",
"description": "Force close window if buffer size reaches this limit."
},
"execution": {
"type": "object",
"title": "Execution Settings",
"properties": {
"alwaysOutputData": {
"type": "boolean",
"title": "Always Output Data",
"description": "Always output data, even on error (if configured).",
"default": false
},
"retryOnFail": {
"type": "boolean",
"title": "Retry On Fail",
"description": "Retry the execution if it fails.",
"default": false
},
"maxTries": {
"type": "integer",
"title": "Max Retries",
"description": "Number of retries.",
"default": 3,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"waitBetweenTries": {
"type": "integer",
"title": "Wait Between Retries (ms)",
"default": 1000,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"continueOnFail": {
"type": "boolean",
"title": "Continue On Fail",
"description": "Do not crash workflow on error.",
"default": false
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
"default": 300000
}
}
}
}
},
"input_contract_schema": {
"type": "object",
"description": "Individual event payload.",
"properties": {
"payload": {
"type": "object"
}
}
},
"output_contract_schema": {
"type": "object",
"description": "Array of buffered payloads.",
"properties": {
"window_items": {
"type": "array",
"items": {
"type": "object"
}
},
"window_meta": {
"type": "object",
"properties": {
"start_time": {
"type": "string"
},
"end_time": {
"type": "string"
}
}
}
}
},
"ports": [
{
"port_id": "out",
"label": "Window",
"is_default": true,
"description": "Emits the batch when window closes."
},
{
"port_id": "error",
"label": "Error",
"description": "Internal failure."
}
],
"execution_mode": "async",
"tags": [
"stream",
"window",
"batch"
],
"is_stateful": true,
"publisher": {
"identity": "org_sommatic_ai",
"profile": {
"name": "Sommatic AI",
"verified": true,
"url": "https://me.veripass.com/sommatic",
"logo_url": null
}
}
}{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"tumbling",
"sliding"
],
"default": "tumbling",
"title": "Window Type"
},
"interval_seconds": {
"type": "integer",
"default": 60,
"title": "Interval (Seconds)"
},
"max_items": {
"type": "integer",
"default": 100,
"title": "Max Items",
"description": "Force close window if buffer size reaches this limit."
},
"execution": {
"type": "object",
"title": "Execution Settings",
"properties": {
"alwaysOutputData": {
"type": "boolean",
"title": "Always Output Data",
"description": "Always output data, even on error (if configured).",
"default": false
},
"retryOnFail": {
"type": "boolean",
"title": "Retry On Fail",
"description": "Retry the execution if it fails.",
"default": false
},
"maxTries": {
"type": "integer",
"title": "Max Retries",
"description": "Number of retries.",
"default": 3,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"waitBetweenTries": {
"type": "integer",
"title": "Wait Between Retries (ms)",
"default": 1000,
"displayOptions": {
"show": {
"retryOnFail": [
true
]
}
}
},
"continueOnFail": {
"type": "boolean",
"title": "Continue On Fail",
"description": "Do not crash workflow on error.",
"default": false
},
"timeout_ms": {
"type": "integer",
"title": "Timeout (ms)",
"description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
"default": 300000
}
}
}
}
}{
"type": "object",
"description": "Individual event payload.",
"properties": {
"payload": {
"type": "object"
}
}
}{
"type": "object",
"description": "Array of buffered payloads.",
"properties": {
"window_items": {
"type": "array",
"items": {
"type": "object"
}
},
"window_meta": {
"type": "object",
"properties": {
"start_time": {
"type": "string"
},
"end_time": {
"type": "string"
}
}
}
}
}[
{
"port_id": "out",
"label": "Window",
"is_default": true,
"description": "Emits the batch when window closes."
},
{
"port_id": "error",
"label": "Error",
"description": "Internal failure."
}
]Execution
- Execution
async- Stateful
- Yes
- Retries (
retryOnFail) - No
- Capabilities
windowingaggregationstreambuffer- Tags
streamwindowbatch
Notes and limits
- The buffer lives in memory during one run only. Entries left when the run ends are discarded and never emitted.
- The example envelope is what the worker returns for one item; the engine intercepts it, and only the batch shown on
outreaches the next node. - Without a
flow.splitupstream the node sees one item per run, so with the defaults nothing is ever emitted; setmax_itemsto the expected number of items, orinterval_secondsto 0.
Reviewed against the orchestrator code · 31e874b · 2026-11-26