The workflow queue contains a list of “workflow tasks” that are due to run at specific times.
Tasks are added to the workflow queue when a workflow’s timing option is set to something other than Run Immediately. Tasks created by manual workflow will also always be added to the queue but are scheduled to run immediately.
The WP-Cron system is used to check whether any queued workflow tasks are due to be run. This WP-Cron event is scheduled to run every two minutes. If there are tasks to be run Action Scheduler will be used to run all the available events.
Developer customization: Update the scheduled date for a queued workflow run.
Increasing speed
↑ Back to topThe rate at which queue workflow tasks are processed will vary based on different factors but there is no fixed limit to the number of tasks that can be processed. Some factors that can negatively effect speed are:
- Poor hosting
- WP-Cron problems, a host or plugin could restrict how often WP-Cron can run, something could be blocking the queue of scheduled cron jobs.
- Background job has paused due to too many failures, check the list of failed Action Scheduler actions for anything that includes
automatewoo/jobs/run_queued_workflows. If there are 5 failures within one hour the job will pause for an hour to protect against infinite scheduled action loops. - Workflows that are configured to perform a high number of slow tasks e.g. API calls, slow database queries
Failed Events
↑ Back to topA queued event can fail because it is missing data. For example, if a workflow task was supposed to email a user but that user has been deleted. When this happens, it remains in the Queue list for 30 days and is marked as failed. From the Queue list you can attempt to run the event again, but it will not reattempt to run by itself.
Filter: automatewoo_failed_events_delete_after
Retire a workflow
↑ Back to topBefore replacing or removing a workflow, go to AutomateWoo > Queue, search for the workflow and select Filter. Decide which queued runs to finish and which to cancel before you move the workflow to Trash.
- Finish queued runs. Keep the current workflow active while you clear its queue. Wait to start the replacement until you’ve cleared the runs you want to finish. Wait for the queued runs to come due, or select Run Now next to a pending item to run it early. While an automatic workflow is active, it can still add new items. Recheck the filtered queue and review AutomateWoo > Logs before you retire the workflow.
- Cancel queued runs. If you’re retiring an automatic workflow, disable it first to stop it from adding new items. In the queue, select the items you want to cancel, choose Delete from Bulk actions, and select Apply. Check that the selected items are gone before enabling a replacement.
What happens to queued runs
↑ Back to topDisabling an automatic workflow or moving it to Trash leaves its queued items in place. If AutomateWoo tries to run one while the workflow is inactive, it marks the item as Failed without running its actions. If you reactivate the workflow, items that are still pending can run on schedule. To rerun a failed item, select Retry in the queue after reactivating the workflow.
Queued runs for a manual workflow can still run after you move it to Trash. Cancel any remaining runs in the queue before trashing the workflow if you want to stop them.
Delete Permanently removes the workflow’s remaining queue entries, including failed items, and its run logs. A replacement workflow has its own queue entries.