Skip to main content

Buffer

Accumulates incoming elements until reaching a defined threshold, then transmits the full batch at once.

Parameters

ParameterTypeRequiredVariableDescription
bufferSizenumberYesNoNumber of items to accumulate before passing them to the next block. (min 1, max 10000)
bufferTimeoutnumberNoNoMaximum delay in milliseconds before flushing the buffer, even if not full.
flushModechoice (size, timeout, both)NoNoFlush trigger: by size, by timeout, or both (whichever comes first). (Default: "size")
outputVariabletextNoNoOutput variable name containing the accumulated items.

Output

Output variable : bufferedData

{
"items": [],
"count": 0
}

Example

Accumulate 10 elements before processing.

Input :

{"item": {"id": 1}}

Output :

{"items": [{"id": 1}, {"id": 2}, "..."], "count": 10}
Tip

{{bufferedData.items}} contains the accumulated array. {{bufferedData.count}} indicates the number of elements in the batch.