Back to Documentation
Tag Operations Node
Count by Query
Count entities matching a tag query and write the count to a tag for branching
Inputs
querystringrequiredTag to match (e.g. symbol:scatter). All entities with this tag are counted.
outputEntityIdstringEntity to write the count tag on
Default: global
outputTagstringrequiredTag prefix for the count (e.g. round:scatterCount → writes round:scatterCount:N)
Outputs
countnumberNumber of entities matching the query
Overview
Runs a tag query (same as TagQuery), counts the matching entities, and writes the count to a tag on the specified entity. The written tag is outputTag:N so that Branch: Tag Compare (flow.branch.tagCompare) can branch on it (e.g. scatterCount ≥ 3).
Typical flow
- Count by Query: query
symbol:scatter, outputTaground:scatterCount - Branch: Tag Compare: pattern
round:scatterCount, operator≥, threshold3
Usage example
Count by Query:
query: "symbol:scatter"
outputEntityId: "global"
outputTag: "round:scatterCount"
// Writes global → round:scatterCount:5 (if 5 scatters)
// Then use flow.branch.tagCompare with pattern "round:scatterCount", >= 3