The Count Value Node is used to count the number of incoming payloads that meet a specified condition. It increments a counter each time a payload contains a specific field with a defined value, and outputs the total as a new field in the workflow JS
What It Does
This node performs conditional counting based on key-value matching within the payload. It is commonly used to track the frequency of specific events, states, or classifications (e.g., count how many times a sensor status equals “Fault”).
Step-by-Step: How to Configure the Count Value Node
-
Add the node
-
Drag the Count Value Node from the Logic panel into your workflow.
-
-
Connect input
-
Link one or more nodes that emit data you want to monitor and count.
-
-
Open configuration
-
Double-click the node to configure its logic.
-
Configuration Fields
Field | Requirement | Description |
---|---|---|
Node Name* | Required | Identifier for this node within the workflow. |
Field to Count* | Required | The JSON key to evaluate in the incoming payload. |
Condition (If) | Optional | Enables conditional logic for counting: – Only count when the field value matches the specified value. |
Field Name* | Required if condition is used | Name of the key to evaluate. |
Field Value* | Required if condition is used | Value to match for count to increment. |
Output Field Name* | Required | The name of the key where the count result will be stored in the outgoing JSON. |
Output Example
If configured to count how many times status = Fault
, the node will output:
{
"fault_count": 3
}
This count increases each time the condition is met, and resets only if explicitly cleared elsewhere in the workflow.
Best Practices
-
Use this node after filtering or transforming data to ensure clean input.
-
Choose unique output field names to avoid key conflicts with upstream or downstream nodes.
-
If you need time-windowed counting, combine this node with a reset trigger or use in tandem with interval-based logic.
-
Ensure that input data is normalized before applying conditional checks (e.g., casing, null safety).
Use Cases
-
Count number of fault states over time
-
Monitor how many times a button is pressed or signal equals “On”
-
Track classified states (e.g., count “Rain” or “Warning” labels)
-
Measure frequency of discrete conditions in event-driven workflows
FAQ
Q: Does the node reset the count?
A: No. It maintains a cumulative count until the workflow is reset or another node clears the value.
Q: Can I count multiple values?
A: No. This node counts a single condition. To count multiple values (e.g., “Warning”, “Fault”), use one Count Value node per condition.
Q: Is case sensitivity enforced?
A: Yes. "Fault"
≠ "fault"
. Ensure value formatting is consistent upstream.