Skip to main content

If

Type ID: core.if  ·  Kind: Action  ·  Trace: CHAIN

Evaluates one or more conditions against input values and routes the result to one of two main outputs. Items satisfying the combined condition go to the first (true) output; everything else goes to the second (false) output.

Credentials

None

Properties

PropertyKeyTypeRequiredDefaultPossible valuesShown when
ConditionsconditionsarrayYes{}A collection of condition rules, grouped by data type (see below)Always
CombinecombineOperationoptionsYesallall — true only if ALL conditions are met; any — true if ANY condition is metAlways

Conditions (nested fields)

Each condition is defined under one of four data-type groups. Every group has value1, operation, and value2.

Booleanvalue1 (boolean, default false), value2 (boolean, default false), operation:

ValueName
equalEqual
notEqualNot Equal

Date & Timevalue1 (dateTime), value2 (dateTime), operation:

ValueName
afterOccurred After
beforeOccurred Before

Numbervalue1 (number, default 0), value2 (number, default 0), operation:

ValueName
smallerSmaller
smallerEqualSmaller or Equal
equalEqual
notEqualNot Equal
largerLarger
largerEqualLarger or Equal
isEmptyIs Empty
isNotEmptyIs Not Empty

Stringvalue1 (string), value2 (string, also a Regex variant), operation:

ValueName
containsContains
notContainsNot Contains
endsWithEnds With
notEndsWithNot Ends With
equalEqual
notEqualNot Equal
regexRegex Match
notRegexRegex Not Match
startsWithStarts With
notStartsWithNot Starts With
isEmptyIs Empty
isNotEmptyIs Not Empty

Notes

  • The node always emits two outputs in order [true, false]. The matching branch receives a single item { result: true } or { result: false }.
  • Comparisons use strict equality for equal/notEqual. Numeric operators coerce via Number(...), string operators coerce via String(...), and date operators parse strings, numbers, or Date objects into milliseconds (an unparseable date throws).
  • isEmpty treats undefined, null, '', NaN, invalid dates, and empty objects as empty; isNotEmpty is its inverse.
  • regex accepts either a bare pattern or a /pattern/flags form. Supported flags: g i m u s y.
  • Evaluation short-circuits: with any it stops at the first match, with all it stops at the first failure.
  • Parameters are resolved through the resolver engine, so expressions are supported.