πŸ”€ If/Else Node

The `If/Else Node` is a type of `condition` node used to branch execution flow based on a set of filter conditions expressed in `JSON Logic`. Unlike the Filter Node, which returns a boolean result, the If/Else Node determines which edge to follow in the diagram.

For more information on JSON logic Click here

πŸ“¦ JSON Representation

{
  "type": "condition",
  "data": {
    "id": "if/else",
    "formData": {
      "filters": {
        "and": [
          {
            "<=": [
              { "var": "effective_at" },
              { "var": "deal.$close_date__12_months" }
            ]
          },
          {
            "==": [
              { "var": "deal.stage" },
              "Won"
            ]
          }
        ]
      }
    },
    "type": "condition"
  }
}

🧾 Form Data Fields

FieldTypeRequiredDescription
filtersJSON objectβœ…A JSON Logic object used to evaluate conditional logic and determine the branch to take (true or false).

βš™οΈ Execution Logic

  1. Preprocessing:
  • Loads required user fields, metrics, and targets referenced in the filter logic.
  1. Evaluation:
  • The filters are evaluated using a JSON logic engine.
  1. Outcome:
  • If the result is true, the true edge of the node is followed.
  • If the result is false, the false edge is followed.
  1. Return Value:
  • Returns the boolean result of the filter evaluation. This value is not used directly by the flow β€” instead, it determines the edge to follow.

βœ… Validation Rules

RuleDescription
Filters must be definedThe filters field must exist.
Filters must not be emptyAt least one logical condition must be present.
Filters must include valuesJSON logic must include actual conditions with values or variables.

πŸ§ͺ Example Logic

{
  "and": [
    {
      "<=": [
        { "var": "effective_at" },
        { "var": "deal.$close_date__12_months" }
      ]
    },
    {
      "==": [
        { "var": "deal.stage" },
        "Won"
      ]
    }
  ]
}

This logic will follow the true path only if:

  • effective_at is before or equal to deal.$close_date__12_months, and
  • deal.stage is "Won".

On this page