AutomateWoo processes many triggers asynchronously by using asynchronous events. Such events are separated from the main event and slightly delayed.
Prior to AutomateWoo 4.8, these async events would always be temporarily stored in the database and run in the background. This happened regardless of whether they were being used or not.
AutomateWoo 4.8 introduces a number of optimizations to how the async events system works. The main difference is that async events will now only run if the site has an active workflow that requires the event.
Let’s say your site isn’t using the Customer Account Created trigger. In that case, AutomateWoo will no longer create an async event when a customer creates an account.
Implications for custom triggers↑ Back to top
Each workflow’s required async events are set by the workflow’s trigger. This means that custom triggers must declare which async events they require if they are triggered by an async event hook.
One example of this is the Order Paid trigger which is initiated by the WordPress action
automatewoo/order/paid_async. This is an async event. It is fired asynchronously by being stored in the database and run shortly after the original order paid event happens. Therefore the Order Paid trigger must declare that it requires the
order_paid async event.
An async event requirement is declared on a trigger with the
$required_async_events property as shown in the code example below.
How do I know if my trigger requires an async event?↑ Back to top
If your trigger uses any of the async action hooks that are listed below you will need to add the event name to the
$required_async_events property of that trigger.
List of async events↑ Back to top
The following is a list of async event names with their corresponding WordPress actions.
- order_created :