arcalot / arcaflow-engine

Arcaflow is a highly-portable workflow engine enabling modular and validated pipelines through containerized plugins.
https://arcalot.io/arcaflow/
Apache License 2.0
7 stars 9 forks source link

Allow logical AND and OR operators in expressions to imply truthiness from node states #218

Open dustinblack opened 1 month ago

dustinblack commented 1 month ago

Please describe what you would like to see in this project

With a standard expression, truthiness can be implied by simply reaching a particular node state in a workflow:

!expr $.steps.example.outputs

However, when a logical AND or OR is added to the expression, the expectation is explicit boolean values on each side. Because of this, it is not currently possible to evaluate multiple node states in an expression. This does not work:

!expr $.steps.example.outputs || $.steps.example.disabled.output

Also, the stringToBool() function does not work in this case since it will only convert explicitly truthy string values like true, false, y, n, 1, 0, etc. So this also does not work:

!expr stringToBool($.steps.example.outputs) || stringToBool($.steps.example.disabled.output)

Please describe your use case

This is particularly important when using a wait_for in a workflow step for explicit dependencies and serialization.