Articles in this section
Category / Section

Delay or Scheduled Workflows not working

2 mins read
Updated:

If your delayed or scheduled workflows in FlowMattic are not working as expected, the most common culprit is a malfunctioning WordPress Cron. By default, WordPress relies on its built-in cron system (WP-Cron) to trigger scheduled tasks, which may fail to execute properly on low-traffic sites.


Why It Happens

The WordPress cron system depends on website traffic to function. If your site has low traffic or no visitors during certain periods:

  • Scheduled tasks, including FlowMattic workflows with delays, may not run.

  • Delays in workflows may not trigger as expected, causing interruptions in your automation.


Solution: Set Up a Server-Side Cron

To ensure consistent execution of delayed and scheduled workflows, you can replace WordPress Cron with a reliable server-side cron job. Here’s how:


1. Using Cloudflare to Trigger the Cron

If you’re using Cloudflare, you can leverage its features to trigger the cron periodically:

  1. Set Up a Custom Cron URL:

    • Install a plugin like WP Crontrol to generate a cron trigger URL for your WordPress site.
  2. Create a Scheduled Task in Cloudflare:

    • Log in to your Cloudflare account.

    • Navigate to Workers or Scheduled Tasks (depending on your Cloudflare plan).

    • Set up a task to call the cron URL every 5 minutes (or a frequency suitable for your workflows).

  3. Save and Test:

    • Confirm that the cron URL is being triggered as expected.

    • Test your delayed or scheduled workflows in FlowMattic.


2. Configure a Cron Job on Your Server

If you have access to your server, setting up a native cron job is the most reliable solution:

  1. Disable WordPress Cron:

    • Edit your wp-config.php file and add the following line: define('DISABLE_WP_CRON', true);
  2. Set Up a Server-Side Cron:

    • Access your server control panel (e.g., cPanel, Plesk) or use SSH if you have root access.

    • Add a new cron job to execute WordPress cron tasks by running the following command every 5 minutes: wget -q -O - https://yourwebsite.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1

    • Replace https://yourwebsite.com with your actual site URL.

  3. Contact Your Hosting Provider:

    • If you’re unfamiliar with server configurations, contact your hosting provider and ask them to set up a cron job for you.

Why Server-Side Cron is Better

  • Reliable Execution: Unlike WordPress Cron, server-side cron jobs don’t depend on site traffic, ensuring tasks are triggered on time.

  • Better Performance: Offloading cron execution to the server reduces the burden on WordPress, improving site performance.


Conclusion

If your delayed or scheduled workflows are not working, the issue likely stems from WordPress Cron’s dependency on traffic. Setting up a server-side cron, either through Cloudflare or your hosting server, ensures reliable execution of scheduled tasks. Once configured, you can trust your workflows to run smoothly, regardless of your site traffic levels. If you need further assistance, don’t hesitate to reach out to the FlowMattic support team!

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Access denied
Access denied