π§ͺ Filter Node
The Filter Node is a type of `condition` node that evaluates a set of filters (expressed in `JSON Logic`) against the input data. If the filter conditions pass, the node returns `true`, allowing the execution flow to continue; otherwise, it returns `false`.
For more information on JSON logic Click here
π¦ JSON Representation
π§Ύ Form Data Fields
| Field | Type | Required | Description |
|---|---|---|---|
filters | JSON object | β | A JSON Logic object that defines the rules to evaluate against the data record. Filters can include nested logical operators like and, or, comparison operators like ==, >=, etc., and variable references (e.g. deal.$amount). |
βοΈ Execution Logic
When the node is processed:
- Field Preprocessing:
- The node loads any user-defined fields, metrics, and targets referenced in the filters using
loadUserFieldsandloadMetricAndTargetValues.
- Evaluation:
- The filter logic is evaluated using a JSON logic engine. The result is a single boolean:
trueβ the filter passed and the flow continues to the next node.falseβ the filter failed and the flow stops or diverges based on diagram logic.
- Output:
- Returns a single
booleanvalue.
β Validation Rules
During diagram validation, the following checks are enforced:
| Rule | Description |
|---|---|
| Filters must be defined | The filters field must exist. |
| Filters must not be empty | At least one logical condition must be present. |
| Filters must include values | JSON logic must include actual conditions with values or variables. |
π§ͺ Example: Filter Logic
Hereβs what the logic from the JSON above means:
This filter will pass (return true) if:
- The
effective_atdate is before or equal todeal.$close_date__12_months, and - The deal stage is
"Won".