Triggered Rule Order Of Execution

The answer to this is probably out there somewhere, but finding it...

If I have a triggered rule such as:
Trigger on, Condition on, perform true actions.

If I also have a false action, is that based on the trigger or the condition? In other words if the trigger is true and the condition is false does it then execute the false action? Or does it execute the false action when the trigger goes false?

The trigger becoming true causes the rule to be evaluated.
So if your conditions are true, the true actions will run.
If your conditions are false, the false actions will run.

A trigger is more or less just an event (or more accurately, something that fires as a result of one). It doesn't have a truth value, so I'm not sure what you mean with "the trigger is true." When the selected trigger event occurs in a triggered rule, the rule (created by combining the condition[s] you specified) is evaluated. The "actions for true" and "actions for false" are then run according to the truth evaluation of the rule. The only role of the trigger is that when it fires, it causes rule evaluation.

In a "regular" (non-triggered), rule, you have everything in a triggered rule except the trigger event. What causes this rule to run is a change in the truth value of any condition; this causes a re-evaluation of the rule and then the running of "actions for true" or "actions for false" if the rule evaluation truth value changed. A triggered rule will evaluate the rule on every trigger action and perform the "actions for true" or "actions for false" every time, regardless of the last rule evaluation truth value. (And just so we cover all the bases: a plain "Trigger" as opposed to a "Triggered Rule" is a sort of super pared-down option you have that will just run actions any time the trigger fires; there is no associated rule or actions for true or false--just "actions.")

Perhaps the confusion is having a Triggered Rule with a trigger like "Switch A turns on." If Switch A is currently off and it turns on, a Triggered Rule with "Switch A turns on" as a trigger event will run. If Switch A turns off, the Triggered Rule with only the above as a trigger will not run. (A recent RM update introduced a "changed" value so you could do "Switch A changes," and then it will.) But in any case, the outcome is entirely dependent on the rule (built using the conditions you specify), not the trigger.

Hope this helps!

1 Like