Skip to main content

Operation

Performs logical operations on multiple boolean values, including AND, OR, XOR, NAND, NOR, and Equal operations. This node is essential for combining multiple conditions and creating complex decision logic in RPA flows.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Values - An array of boolean values to perform the operation on. You can add multiple boolean inputs by clicking the "Add Value" button. Each value can be:
    • A direct boolean value (true/false)
    • A variable containing a boolean value
    • A JavaScript expression that evaluates to a boolean
    • An AI-generated boolean value
tip

The operation is performed sequentially on all values in the order they are defined. The first value is used as the initial value, and subsequent values are combined using the selected operation type.

Options

  • Operation Type - The type of logical operation to perform on the boolean values:
    • And - Returns true only if ALL values are true
    • Or - Returns true if AT LEAST ONE value is true
    • Xor - Returns true if EXACTLY ONE value is true (exclusive or)
    • Nand - Returns true if NOT ALL values are true (NOT AND)
    • Nor - Returns true only if ALL values are false (NOT OR)
    • Equal - Returns true if all values are equal to each other

Output

  • Result - The boolean result of the logical operation, stored in the Message scope with the name result.

Logical Operations Explained

AND Operation

Returns true only when all input values are true.

Truth Table:

Value 1Value 2Result
truetruetrue
truefalsefalse
falsetruefalse
falsefalsefalse

Use Case: Verify that all conditions are met before proceeding.

OR Operation

Returns true when at least one input value is true.

Truth Table:

Value 1Value 2Result
truetruetrue
truefalsetrue
falsetruetrue
falsefalsefalse

Use Case: Check if any condition is satisfied to trigger an action.

XOR Operation (Exclusive OR)

Returns true when exactly one value is true (odd number of true values).

Truth Table:

Value 1Value 2Result
truetruefalse
truefalsetrue
falsetruetrue
falsefalsefalse

Use Case: Ensure that only one of multiple mutually exclusive conditions is met.

NAND Operation (NOT AND)

Returns the opposite of AND operation.

Truth Table:

Value 1Value 2Result
truetruefalse
truefalsetrue
falsetruetrue
falsefalsetrue

Use Case: Detect when not all conditions are met.

NOR Operation (NOT OR)

Returns true only when all values are false.

Truth Table:

Value 1Value 2Result
truetruefalse
truefalsefalse
falsetruefalse
falsefalsetrue

Use Case: Verify that none of the conditions are true.

EQUAL Operation

Returns true when all values are equal to each other.

Examples:

  • [true, true, true]true
  • [false, false, false]true
  • [true, false, true]false

Use Case: Check if all conditions have the same boolean state.

How It Works

When executed, the Operation node:

  1. Retrieves all boolean values from the Values array
  2. Uses the first value as the initial result
  3. Iterates through remaining values, applying the selected operation type
  4. Stores the final result in the output variable

Processing Example (AND operation):

Values: [true, true, false, true]
Step 1: result = true (first value)
Step 2: result = true AND true = true
Step 3: result = true AND false = false
Step 4: result = false AND true = false
Final: result = false

Use Cases

1. Multi-Condition Validation

Check if a record meets all validation criteria before processing:

Values:

  • ${msg.emailValid} - Email format is correct
  • ${msg.ageValid} - Age is within acceptable range
  • ${msg.addressValid} - Address is complete

Operation: AND

Result: true only if all validations pass

2. Feature Flag Checking

Proceed if any feature flag is enabled:

Values:

  • ${global.betaFeaturesEnabled}
  • ${msg.userHasBetaAccess}
  • ${flow.overrideEnabled}

Operation: OR

Result: true if any condition allows access

3. Exclusive Mode Selection

Ensure only one processing mode is active:

Values:

  • ${msg.fastMode}
  • ${msg.accurateMode}

Operation: XOR

Result: true only if exactly one mode is selected

4. Error Detection

Check if any error conditions exist:

Values:

  • ${msg.networkError}
  • ${msg.authError}
  • ${msg.dataError}

Operation: OR

Result: true if any error is present

5. State Consistency Check

Verify all systems report the same state:

Values:

  • ${msg.database1Ready}
  • ${msg.database2Ready}
  • ${msg.database3Ready}

Operation: EQUAL

Result: true if all databases have the same ready state

Examples

Example 1: Access Control

Check if user has proper permissions:

Configuration:

  • Value 1: ${msg.isAuthenticated}
  • Value 2: ${msg.hasValidSubscription}
  • Value 3: ${msg.accountActive}
  • Operation Type: AND
  • Result: true only if user is authenticated, has valid subscription, and account is active

Example 2: Notification Trigger

Send notification if any alert condition is true:

Configuration:

  • Value 1: ${msg.criticalError}
  • Value 2: ${msg.highPriority}
  • Value 3: ${msg.userRequested}
  • Operation Type: OR
  • Result: true if any notification trigger condition is met

Example 3: Conflict Detection

Detect conflicting settings:

Configuration:

  • Value 1: ${msg.autoModeEnabled}
  • Value 2: ${msg.manualModeEnabled}
  • Operation Type: XOR
  • Result: true if exactly one mode is enabled (valid state), false if both or neither are enabled (invalid state)

Example 4: Safety Check

Proceed only if no safety concerns exist:

Configuration:

  • Value 1: ${msg.systemOverheating}
  • Value 2: ${msg.memoryExhausted}
  • Value 3: ${msg.diskFull}
  • Operation Type: NOR
  • Result: true only if no safety issues are detected

Example 5: Synchronization Verification

Check if all services report the same synchronization status:

Configuration:

  • Value 1: ${msg.service1Synced}
  • Value 2: ${msg.service2Synced}
  • Value 3: ${msg.service3Synced}
  • Operation Type: EQUAL
  • Result: true if all services report the same sync status (all true or all false)

Tips for Effective Use

  1. Order Matters for Performance

    • For AND operations, place conditions most likely to be false first
    • For OR operations, place conditions most likely to be true first
    • This doesn't change the result but can provide clarity in complex flows
  2. Use Descriptive Node Names

    • Example: "Validate All Permissions" for AND operations
    • Example: "Check Any Error Condition" for OR operations
  3. Combine with If Nodes

    • Use the result of Operation nodes directly in If nodes for conditional flow control
    • Example: ${msg.result} to check if the operation succeeded
  4. Document Complex Logic

    • When combining many boolean values, add comments explaining what each represents
    • Use the node's Name property to describe the overall logic
  5. Consider Readability

    • If you have more than 5-6 values, consider breaking into multiple Operation nodes
    • This makes the logic easier to understand and debug
  6. Test Edge Cases

    • Test with all values true
    • Test with all values false
    • Test with mixed values
    • Test with single value

Common Errors and Solutions

Error: "Invalid operation type"

Cause: The operation type specified is not one of the supported values.

Solution:

  • Ensure you're using one of: and, or, xor, nand, nor, equal
  • Check that the operation type hasn't been modified incorrectly

Error: "Value is undefined"

Cause: One or more of the input values is undefined or hasn't been set.

Solution:

  • Ensure all value sources exist and have been set by previous nodes
  • Add default values or error handling before the Operation node
  • Check JavaScript expression syntax in value inputs

Error: "Type mismatch"

Cause: One or more input values is not a boolean type.

Solution:

  • Convert values to boolean: ${!!msg.value}
  • Use comparison operators: ${msg.count > 0}
  • Verify the source data types

Unexpected Results with XOR

Cause: XOR with more than 2 values may produce unexpected results if you expect "only one true" behavior.

Solution:

  • XOR returns true if an odd number of values are true
  • For "exactly one true" with multiple values, consider using alternative logic
  • Test with your specific value combinations to verify behavior

Best Practices

  1. Start Simple - Begin with 2 values and add more as needed
  2. Use Meaningful Names - Name each value input to describe what it represents
  3. Validate Inputs - Ensure all values are actually boolean before the operation
  4. Test Thoroughly - Test all possible combinations of your boolean values
  5. Document Intent - Use the node name to clearly state what the operation checks
  6. Consider Alternatives - For very complex logic, multiple simpler operations may be clearer
  7. Handle Errors - Use Continue On Error wisely, and add error handling for critical operations

Performance Considerations

  • Operations are performed sequentially, which is fast for boolean values
  • No significant performance difference between operation types
  • Consider the number of values - more values mean more operations
  • For very large numbers of boolean values (100+), consider restructuring your logic
  • Assign - Assign boolean values that will be used as inputs to the Operation node
  • ToString - Convert the operation result to a string for logging or display
  • If - Use operation results for conditional flow control
  • Switch - Make complex decisions based on operation results