Skip to main content
Version: 2.1
Counter Node parameters

Counter node configuration

Counter Node

Overview

The Counter Node maintains a persistent numeric counter that increments by a configurable step on every execution. The count survives pipeline restarts, making it ideal for tracking production totals, sequencing records, or triggering logic after a fixed number of events. When a threshold is configured, the counter automatically resets to its initial value once reached, enabling batch-cycling workflows without extra nodes.


Core Functionality

What It Does

1. Persistent Count Tracking The counter state is stored per pipeline and node, so the value survives pipeline restarts and redeployments. Each execution atomically reads, increments, and writes back the count.

2. Configurable Step Set the Step parameter to any non-zero integer. Positive values count up, negative values count down. The step is applied on every normal execution and on manual Increment/Decrement actions.

3. Threshold Auto-Reset When Threshold is greater than zero and the counter reaches or exceeds it, the node sets threshold_reached to true in the output and resets the counter to Initial Value. If no threshold is configured, an internal safety limit of 1 billion prevents overflow.

4. Concurrent Safety Counter updates use atomic read-modify-write operations at the storage layer, so concurrent pipeline executions or manual actions cannot cause lost updates.

5. Manual Actions Operators can increment, decrement, inspect, or reset the counter at any time through the node's action menu—without triggering a full pipeline execution.


Configuration Reference

Parameters

ParameterTypeDefaultRequiredConstraintsDescription
Initial Valuenumber0NoStarting value and the value restored after a threshold reset.
Stepnumber1NoCannot be zeroAmount added to the counter on each execution. Use a negative number to count down.
Thresholdnumber0NoCannot be negative (0 = disabled)When the counter reaches this value it auto-resets to Initial Value and emits threshold_reached: true.

Settings

SettingOptionsDefaultDescription
Timeout (seconds)numberPipeline defaultMaximum execution time for this node (1--600).
Retry on TimeoutPipeline Default / Enabled / DisabledPipeline DefaultWhether to retry on timeout.
Retry on FailPipeline Default / Enabled / DisabledPipeline DefaultWhether to retry on failure. When Enabled, shows Advanced Retry Configuration.
On ErrorPipeline Default / Stop Pipeline / Continue ExecutionPipeline DefaultBehavior when node fails after all retries.

Advanced Retry Configuration

Only visible when Retry on Fail is set to Enabled.

FieldTypeDefaultRangeDescription
Max Attemptsnumber31--10Maximum retry attempts.
Initial Delay (ms)number1000100--30,000Wait before first retry.
Max Delay (ms)number1200001,000--300,000Upper bound for backoff delay.
Multipliernumber2.01.0--5.0Exponential backoff multiplier.
Jitter Factornumber0.10--0.5Random jitter.

Input / Output

Input

The Counter Node accepts any payload. The input data is passed through to the output unchanged under the input key.

Output

Every execution produces a JSON object with three fields:

{
"count": 42,
"input": { "...original payload..." },
"threshold_reached": false
}
FieldTypeDescription
countnumberThe counter value after the current step is applied.
inputanyThe original input payload, passed through unchanged.
threshold_reachedbooleantrue when the counter reached the threshold and was auto-reset during this execution; false otherwise.

Manual Actions

Actions can be triggered from the node's context menu without running the pipeline.

ActionDescription
IncrementAdd the configured step (or a custom value) to the counter. Respects threshold auto-reset.
DecrementSubtract the configured step (or a custom value) from the counter.
Get CountReturn the current counter value and threshold status without modifying state.
ResetSet the counter back to the configured Initial Value.
note

Increment and Decrement actions accept an optional custom value. When provided, the custom value is used instead of the configured Step.


Usage Examples

Example 1: Production Line Unit Counter

FieldValue
Initial Value0
Step1
Threshold0 (disabled)

Each sensor event triggers the pipeline. The counter increments by 1 and the output's count field tracks the running total of units produced. Because the threshold is disabled, the counter grows indefinitely (up to the internal safety limit).

Example 2: Batch Counter with Threshold

FieldValue
Initial Value0
Step1
Threshold50

Every item passing through increments the counter. On the 50th item, threshold_reached becomes true and the counter resets to 0. Downstream nodes can branch on threshold_reached to trigger batch-completion logic—e.g., sending a summary report or closing a work order.

Example 3: Countdown Timer

FieldValue
Initial Value100
Step-1
Threshold0 (disabled)

The counter starts at 100 and decrements by 1 on each execution, enabling countdown-style logic. A downstream Condition node can check count == 0 to fire an alert when the countdown completes.


Best Practices
  • Use threshold auto-reset for batch cycling. Instead of adding a separate Condition + Reset flow, set a threshold to let the counter self-manage.
  • Negative steps are useful for countdowns. Pair them with a downstream condition that checks count reaching zero.
  • Use Get Count during development to inspect the counter without side effects.
note

The counter state is scoped to a specific pipeline and node. Cloning a pipeline creates an independent counter that starts from the configured Initial Value.