Skip to content

Action Scheduler

Action Scheduler is the background job queue that ships inside WooCommerce and other plugins. It runs tasks such as subscription payments, webhooks and emails later, in batches, and logs each one. When its queue stops moving, those jobs wait.

By
WP Ministry
Published

In short

  • Action Scheduler is the queue behind WooCommerce's background work. Its screen is under WooCommerce, then Status, then Scheduled Actions.
  • WP-Cron starts it once a minute, and so do page loads in the dashboard. When WP-Cron cannot run, the queue backs up.
  • A few past-due actions are normal. Several that are more than a day old, or a growing count of Failed ones, need a look.

Action Scheduler is a job queue for WordPress. A plugin hands it a task and a time, and Action Scheduler runs the task in the background and records what happened. It ships inside WooCommerce. Its own site says it processes payments for Subscriptions, webhooks for WooCommerce, and emails and other events for a range of other plugins. Each task is called an action.

It does not run by itself. WP-Cron starts it once a minute, and so does a page load in the dashboard when actions are waiting. Each run takes a batch of 25 actions and keeps going for up to 30 seconds, then asks the site to carry on in a new request.

The two sets of documentation disagree in places. WooCommerce's page says actions are stored as a custom post type and sent in batches of 20, up to five queues at once. Action Scheduler's own documentation says version 3.0 and newer store actions in tables whose names begin actionscheduler_, claim 25 at a time, and run one batch at a time by default. Its source also sets the batch at 25. Both name the WP-Cron hook action_scheduler_run_schedule. In the source, and in wp cron event list, the event is action_scheduler_run_queue.

Where you meet it

Go to WooCommerce, then Status, then Scheduled Actions. The same screen is under Tools, then Scheduled Actions. Links above the table filter by status, each with a count.

On the screenWhat it means
PendingWaiting for its time or for the queue. The row offers "Run" and "Cancel".
Past-dueA filter, not a status: Pending actions whose scheduled time has passed.
In-progressBeing run now. An action that runs for more than five minutes is marked Failed.
CompleteIt ran.
FailedIt hit an error or timed out. The Log column holds the error where one could be recorded.
CanceledIt was canceled and will not run.

In the database, its tables carry the site's table prefix. With the default prefix they are wp_actionscheduler_actions, wp_actionscheduler_claims, wp_actionscheduler_groups and wp_actionscheduler_logs.

What goes wrong

  • The queue is not being run. Actions stay at Pending and the Past-due count climbs. Check WP-Cron first. If it is switched off, or the site cannot reach itself, the queue moves only while someone works in the dashboard. How to fix "Missed schedule" covers getting WP-Cron running again.
  • A WooCommerce database update does not finish. WooCommerce database update required shows how to follow the update on this screen and run it by hand.
  • Actions fail. Filter to Failed and read the Log column to see why.
  • The tables grow. Action Scheduler deletes actions that were completed or canceled more than a month ago, and logs every event for every action. Why the WooCommerce dashboard is slow covers a backlog and an oversized log.

Before a sale, the sale readiness checklist has you read this screen once, so you know what normal looks like.

How to look at yours

With WP-CLI, this prints the count of actions in each status, with the oldest and newest date for each:

bash
wp action-scheduler status

Common questions

Is it normal to have past-due actions?

A few, yes. Action Scheduler's documentation says "it is normal to have some past-due actions" because of how WP-Cron works. Several that are more than a day old may mean something is wrong with the site.

Does Action Scheduler replace WP-Cron?

No. Its documentation says it is designed to work alongside WP-Cron and, by default, is started by it.

Is Action Scheduler only part of WooCommerce?

No. It is a library made to be shipped inside plugins, and WooCommerce is one of them. Without WooCommerce, the screen is under Tools, then Scheduled Actions.

Not sure what is wrong?

Tell us what you see. We reply with the cause and a fixed quote, and the diagnosis is free.