Math and Logic Nodes
Math and Logic nodes provide powerful computational and logical operations in ANDRON workflows, enabling complex data transformations and decision-making processes.
Math and Logic nodes provide powerful computational and logical operations in ANDRON workflows, enabling complex data transformations and decision-making processes.
Comparison Node
The Comparison Node evaluates relationships between values, supporting multiple comparison types.
Configuration
- Comparison Type:
equals: Check strict equalitynotEquals: Check inequalitygreaterThan: Check if left value is greaterlessThan: Check if left value is lessgreaterThanOrEqual: Check if left value is greater or equallessThanOrEqual: Check if left value is less or equaltypeOf: Check the JavaScript type of a valueinstanceOf: Check object instance type
Example
{
"type": "comparison",
"name": "Age Validation",
"leftOperand": "{{user.age}}",
"rightOperand": 18,
"comparisonType": "greaterThanOrEqual",
"returnType": "boolean"
}
Use Cases
- Data validation
- Age restrictions
- Type checking
- Conditional routing
Mathematical Operation Node
Perform arithmetic and advanced mathematical computations.
Configuration
- Operation Type:
add: Additionsubtract: Subtractionmultiply: Multiplicationdivide: Divisionmodulo: Remainder calculationpower: Exponentiationsqrt: Square rootabs: Absolute valueround: Roundingfloor: Floor valueceiling: Ceiling value
Example
{
"type": "math",
"name": "Price Calculation",
"operation": "multiply",
"operands": ["{{product.basePrice}}", "{{product.quantity}}"],
"roundTo": 2
}
Use Cases
- Financial calculations
- Inventory management
- Scientific computations
- Dynamic pricing
Boolean Logic Node
Perform complex logical operations combining multiple conditions.
Configuration
- Logic Type:
and: Logical AND (all conditions must be true)or: Logical OR (at least one condition true)not: Logical NOT (invert a condition)xor: Exclusive OR (exactly one condition true)
Example
{
"type": "boolean",
"name": "User Access Check",
"logicType": "and",
"conditions": [
{
"type": "comparison",
"leftOperand": "{{user.isVerified}}",
"rightOperand": true
},
{
"type": "comparison",
"leftOperand": "{{user.role}}",
"rightOperand": "admin"
}
]
}
Use Cases
- Complex authorization checks
- Multi-condition validation
- Advanced filtering
- Permission management
Error Handling
- Nodes provide detailed error messages for invalid operations
- Type coercion and strict type checking
- Configurable error handling strategies
- Comprehensive logging of computational steps
Performance Considerations
- Optimized for high-performance computational tasks
- Minimal overhead for simple operations
- Efficient memory management
- Configurable precision for floating-point calculations
Security Notes
- All input values are sanitized before computation
- Prevent potential injection or unexpected type conversion
- Configurable type strictness
- Secure handling of mathematical edge cases
Advanced Features
- Support for dynamic operand resolution
- Template string interpolation
- Complex nested condition support
- Configurable error tolerance
- Extensible through custom computation plugins
Precision and Limitations
- Default floating-point precision: 15 decimal places
- Large number support up to JavaScript's Number.MAX_SAFE_INTEGER
- BigInt support for extended numerical range
- Configurable rounding and precision modes
Last updated: 12/2/2025