Title: Webhooks Processing
Last modified: June 17, 2020

---

# Webhooks Processing

 *  Resolved [RJRISO](https://wordpress.org/support/users/rjriso/)
 * (@rjriso)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/webhooks-processing/)
 * Slow processing of webhooks remains a problem. I have looked at the async filter
   solution, but when I employ that, I get incomplete order objects. There has to
   be a better way.
 * I have webhooks that sometimes don’t fire for 20-90 minutes after an order is
   created. The order acknowledgement and notification emails fire immediately. 
   Can’t we do the same with webhooks?
 * Alternatively can webhook processing be tied to a custom chron job?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [jessepearson](https://wordpress.org/support/users/jessepearson/)
 * (@jessepearson)
 * Automattic Happiness Engineer
 * [5 years, 10 months ago](https://wordpress.org/support/topic/webhooks-processing/#post-13176440)
 * [@rjriso](https://wordpress.org/support/users/rjriso/)
 * >  I have looked at the async filter solution, but when I employ that, I get 
   > incomplete order objects.
 * Do you mean using the `woocommerce_webhook_deliver_async` filter? If so, I can
   understand why there would be incomplete order objects as they probably haven’t
   saved to the database yet.
 * > I have webhooks that sometimes don’t fire for 20-90 minutes after an order 
   > is created. The order acknowledgement and notification emails fire immediately.
   > Can’t we do the same with webhooks?
 * Processing webhooks could cause delays elsewhere. Like if an order is being created
   and a webhook is fired and the receiving site is slow, it could slow processing
   of the order, which results in a bad user experience.
 * The `wc_webhook_process_delivery` function is what is called to create the webhook
   actions. This function is defined and hooked here:
    [https://github.com/woocommerce/woocommerce/blob/4.3.1/includes/wc-webhook-functions.php#L18-L40](https://github.com/woocommerce/woocommerce/blob/4.3.1/includes/wc-webhook-functions.php#L18-L40)
 * When a webhook action happens, it schedules the webhook to be fired off via Action
   Scheduler. Action Scheduler should run once a minute as long as someone is logged
   into the admin, but if no one is logged in it is going to rely upon traffic to
   the site. This may be the reason why you see delays with the webhooks being delivered.
 * Pending scheduled actions can be seen under WooCommerce > Status > Scheduled 
   Actions > Pending.
 * > Alternatively can webhook processing be tied to a custom chron job?
 * This might be possible, but shouldn’t be needed. If you want to create a server
   based cron to run the `action_scheduler_run_queue` WP Cron event once a minute,
   that should suffice to get all scheduled actions running on time.
 *  [jessepearson](https://wordpress.org/support/users/jessepearson/)
 * (@jessepearson)
 * Automattic Happiness Engineer
 * [5 years, 10 months ago](https://wordpress.org/support/topic/webhooks-processing/#post-13210539)
 * We haven’t heard back from you in a while, so I’m going to mark this as resolved.
   If you have any further questions, a new thread can be opened.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Webhooks Processing’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [webhooks](https://wordpress.org/support/topic-tag/webhooks/)

 * 2 replies
 * 2 participants
 * Last reply from: [jessepearson](https://wordpress.org/support/users/jessepearson/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/webhooks-processing/#post-13210539)
 * Status: resolved