Docs »

Automations »

Commands »

decision

The decision: command conditionally selects one of multiple potential outcomes.

Syntax



start:
  decision:
    outcome/weekend:
      if@bool: {{'now'|date('l') in ['Saturday','Sunday'] ? 'yes'}}
      then:
        return:
          output: It is the weekend.
    outcome/weekday:
      then:
        return:
          output: It is a weekday.


outcome:

A decision has multiple outcome: commands. The first matching outcome is used.

Each outcome must have a unique name.

Key  
if@bool: This key should resolve to a yes or no value to determine whether this outcome is desirable.
then: If this outcome matches, the commands to run.