Scheduling
Last updated
Was this helpful?
Last updated
Was this helpful?
and runs may be scheduled to perform in the future. They will not have any effect until they are performed. This means that their eventual performance may be impacted by changes to a store's Mechanic account, prior to the scheduled performance time.
Event runs may be scheduled using the action, using its run_at
option to define the time at which the run should be performed.
The task runs that arise from a scheduled event run will not be established until the event run is performed. (This does not apply if the task_ids
option is used, which determines ahead of time which tasks may be run in response to the new event.) This means that changes to the set of enabled tasks can have an impact on what tasks are actually run, in response to a scheduled event run.
Mechanic supports several (such as mechanic/scheduler/hourly), allowing tasks to be automatically invoked by the platform on a regular repeating interval.
Event runs generated in response to scheduler events are always adjusted for the store's local time.
Task runs may be scheduled using , in which a task states that it wishes to run later (by some amount of time) than the event that triggers it.
Subscription offsets are a property of the task, and are applied by the task run â not the event run. This means that the subscribed-to event must be created and run before the subscription offset is calculated and applied.
If a task is disabled or deleted at the time a task run comes due, the task run will still perform at the scheduled time, but will fail instantly.
To achieve precise scheduling (e.g. "run on December 16th at 2:30pm"), or to accomplish scheduling for an interval not supported by Mechanic's scheduler topics, use the action to schedule an event run at any chosen time, with a . Make sure that the desired task is subscribed to the same custom topic, and consider using the Event action's task_id
option to specify that only the desired task is allowed to respond to the new event.
Task runs that are scheduled for the future will always use a task's latest configuration, including the task's , , and .