Portal Community
Single property, infinite flexibility: The If Condition node has exactly one configurable property — condition. This simplicity is intentional: the entire power of this node lives in the expression string, which is evaluated by BizFirstAI's Jint-based JavaScript engine at runtime.

Properties

Property Type Required Default Description
condition string (expression) Required none A JavaScript or BizFirst expression that evaluates to a truthy or falsy value. Evaluated at runtime by the Jint JS engine. Has full access to workflow context via $var, $ctx, $input, and $output directives.

Expression Support

The condition property is evaluated by BizFirstAI's IExpressionEvaluator service, which wraps the Jint JavaScript interpreter. This means the condition supports the full ECMAScript expression syntax, including:

BizFirst Directives (Variable Access)

Before the expression is sent to Jint, BizFirstAI resolves any BizFirst-style directives. These allow you to inject runtime values into the expression string:

Directive Resolves To Example
$var.name A named workflow variable from the execution context $var.orderTotal > 1000
$ctx.path A path into the full execution context object $ctx.customer.tier === 'gold'
$input.field A field from the node's incoming execution data $input.status !== null
$output.node.field Output from a previously executed named node $output.ValidateStep.isValid === true

Supported JavaScript Operators

Operator Description Example
===, !== Strict equality / inequality $var.status === 'active'
==, != Loose equality / inequality $var.count != null
>, <, >=, <= Numeric comparisons $var.amount >= 500
&&, ||, ! Logical AND, OR, NOT $var.active && !$var.suspended
?: Ternary expression (returns truthy/falsy) $var.score > 80 ? true : false

String Method Expressions

Because the Jint engine evaluates full JavaScript, you can use string methods within your condition:

// Check if a string starts with a prefix
$var.email.startsWith('admin@')

// Check array includes
['gold','platinum'].includes($ctx.customer.tier)

// String length check
$var.description.length > 0
Falsy values: A condition that cannot be evaluated (e.g., reference to an undefined variable) will resolve to false and route to the false port rather than throwing a workflow error. Always test your conditions with representative data to ensure the expected branch fires.
Tip — Keep conditions readable: Complex nested conditions can be hard to maintain. Consider using a Set Variable node before the If Condition to pre-compute a named boolean variable (e.g., isEligibleForDiscount), then use $var.isEligibleForDiscount === true as the condition. This keeps your workflow graph self-documenting.