Budibase / budibase

Low code platform for building business apps and workflows in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s, and more 🚀
https://budibase.com
Other
20.96k stars 1.42k forks source link

Allow for (nested) if/then Automation Flows - Implementation Suggestion: Condition = false skips steps rather than stops automation #13671

Open thinkbig1979 opened 2 weeks ago

thinkbig1979 commented 2 weeks ago

Currently, the 'Condition' action step module completely stops the automation in its tracks if the result of the condition evaluation is false. This means that nothing you have in the chain after that even gets an input value, preventing you from running any further conditions.

This is what is output to the test runner console:

{   "success": true,
    "result": false,
    "refValue": "true",
    "comparisonValue": "false",
    "status": "stopped" 
}

Ideally, the condition step would allow the user to create a visual branch for the true and false outputs, but failing that, my suggestion would be the following:

IF the condition returns true
       THEN continue as normal.

IF the condition returns false, 
      THEN  
      Store a reference to that particular condition step in memory 
      Skip any automation steps following that step until 
      you reach a condition step that evaluates the result of the stored condition step.
      Continue the automation flow from that point. 

Given the fact that a condition only has two possible outcomes (true/false), evaluating it more than twice makes no sense anyway, and limiting the state to storing only the last actioned condition module is enough to do things like below. That way you effectively allow for nested if/then conditions to be created without adding much complexity to the code.

linear[bot] commented 2 weeks ago

BUDI-8244 Allow for (nested) if/then Automation Flows - Implementation Suggestion: Condition = false skips steps rather than stops automation