Skip to content

Commit dc0d9e5

Browse files
committed
[IMP] studio: clarifying logic for time-triggered automation rules
task-5335209
1 parent bcec04a commit dc0d9e5

File tree

1 file changed

+47
-11
lines changed

1 file changed

+47
-11
lines changed

content/applications/studio/automated_actions.rst

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -153,33 +153,69 @@ You can then define:
153153

154154
- a :guilabel:`Delay`: Specify the number of :guilabel:`Minutes`, :guilabel:`Hours`,
155155
:guilabel:`Days`, or :guilabel:`Months` after which the action should be triggered. If you
156-
selected the :guilabel:`Based on date field` trigger, the action can be triggered
157-
:guilabel:`After` or :guilabel:`Before` the selected date field.
156+
selected the :guilabel:`Based on date field` trigger, the action can be executed :guilabel:`After`
157+
or :guilabel:`Before` the selected date field.
158+
159+
The delay is used to determine the scheduled trigger date and time of the action.
158160

159161
.. note::
160162
By default, the scheduler checks for time-triggered automation rules every 240 minutes, or 4
161-
hours. This frequency is generally sufficient for delays such as 3 months after the order date
163+
hours. If, since the previous check, the scheduled trigger date and time of an action has been
164+
reached, the action is executed.
165+
166+
The default frequency is generally sufficient for delays such as 3 months after the order date
162167
or 7 days after the last update.
163168

164-
For delays of less than the equivalent of 2400 minutes, or 40 hours, the system recalculates
165-
the frequency of this check to ensure that more granular delays, e.g., 1 hour before the event
166-
start date and time, or 30 minutes after creation, can be respected as closely as possible.
169+
However, for delays of less than the equivalent of 2400 minutes, or 40 hours, the system
170+
recalculates the frequency of this check to ensure that more granular delays, e.g., 1 hour
171+
before the event start date and time, or 30 minutes after creation, can be respected as closely
172+
as possible.
167173

168-
To view or manually edit the frequency of the scheduler for a time-triggered automation rule,
169-
with :ref:`developer mode activated <developer-mode>`, click :guilabel:`Scheduled action`.
174+
To view or manually edit the frequency of the check, with :ref:`developer mode activated
175+
<developer-mode>`, click :icon:`fa-arrow-right` :guilabel:`Scheduled action`.
170176

171177
.. image:: automated_actions/trigger-delay-scheduled-action.png
172178
:alt: Direct link to scheduled action for automations
173179

174180
In the :guilabel:`Automation Rules: check and execute` scheduled action that opens, update the
175181
value of the :guilabel:`Execute Every` field, if desired. Clicking :guilabel:`Run Manually`
176-
triggers the scheduled action to run immediately. To return to the automation rule setup, click
177-
the automation rule name in the breadcrumbs.
182+
runs *the scheduled action* immediately. To return to the automation rule setup, click the
183+
automation rule name in the breadcrumbs.
178184

179185
- :guilabel:`Extra Conditions`: Click :guilabel:`Add condition`, then specify the conditions to be
180186
met for the automation rule to run. Click :guilabel:`New Rule` to add another condition.
181187

182-
The action is executed when the delay is reached and the conditions are met.
188+
The action is executed the first time the :guilabel:`Automation Rules: check and execute` scheduled
189+
action runs after the scheduled trigger date and time is reached and the conditions are met.
190+
191+
.. important::
192+
Manually running the :guilabel:`Automation Rules: check and execute` *scheduled action* does not
193+
necessarily result in an *automation rule's action* being executed. An action is only executed
194+
when its scheduled trigger date and time falls *between* the last run of the scheduled action and
195+
the current run (whether scheduled or run manually):
196+
197+
**last run --> scheduled trigger date and time --> current run**
198+
199+
.. example::
200+
At 11:00 am on October 15 you create an automation rule that triggers the sending of an
201+
email 30 days before the :guilabel:`Contract end date`; contracts end at 11:59 pm on their
202+
contract end date. The :guilabel:`Automation Rules: check and execute` scheduled action is
203+
set to run every four hours.
204+
205+
This new rule will apply for contracts whose end date is at least 30 days *after* the
206+
creation of the rule, i.e., an end date of November 14 or later. This is because until that
207+
moment, the scheduled trigger date of `contract end date` - `30 days` will always be
208+
*earlier than* the last run of the scheduled action.
209+
210+
For a contract with an end date of November 14, the scheduled trigger date and time is
211+
11:59 pm on October 15. The action will therefore be executed the first time the
212+
:guilabel:`Automation Rules: check and execute` scheduled action runs after that date and
213+
time has passed, i.e.,:
214+
215+
- last run of the scheduled action: evening of October 15 (the scheduler runs minimum every 4
216+
hours)
217+
- scheduled trigger date and time: 11:59 pm on October 15
218+
- current run of the scheduled action: 3:59 am on October 16 at the latest
183219

184220
.. _studio/automated-actions/trigger-custom:
185221

0 commit comments

Comments
 (0)