Condition (If/Else)
Lyntaris allows you to split your Agentflow into different branches depending on If/Else conditions evaluated inside a secure Node.js sandbox.

Condition node on the V2 Agentflow Canvas
Input Variables
The Condition node accepts dynamic inputs via variable assignment. It typically takes in values from any nodes that have a json output. Some examples are: Custom Function output, LLM Chain Output Prediction, or other upstream nodes.
You can map the input values by giving them a mapped variable name.
This variable can then be used in the If Function and Else Function with the prefix $. For example:
$output
Condition Name
You can name the node for easier visualization of what it does on the canvas.
If Function
This is a piece of JavaScript code that is executed in a secure Node.js sandbox. It must:
- Contain the
ifstatement - Return a value within the
ifstatement
This gives much more flexibility for users to do complex comparison like regex, date comparison and many more.
Else Function
Similar to the If Function, it must return a value. This function will only be executed if the If Function does not return a value.
Output
When the If Function successfully returns a value, it will be passed to the True output anchor. This allows you to route the value to the next node in the flow.
Otherwise, the returned value from the Else Function will be passed to the False output anchor.