Articles in this section
Category / Section

How FlowMattic Workflows Run Asynchronously in the Background?

3 mins read
Updated:

When you create a workflow in FlowMattic, you might wonder: Does this slow down my website or checkout process? The answer is: mostly asynchronous, but it depends on the type of trigger being used.

FlowMattic is designed to execute workflows in the background for optimal performance. However, some WordPress plugin–based triggers may briefly run synchronously before completing. Let’s break this down.


What Does Asynchronous Execution Mean?

  • Asynchronous: Tasks are triggered and handled in the background without blocking the main process.
  • Synchronous: Tasks are executed step by step within the same process, potentially delaying the original action.

By default, FlowMattic aims to run workflows asynchronously — but WordPress’s own hook system can sometimes make things run in the same PHP session.


Case 1: WooCommerce Order Paid Trigger (Asynchronous)

Example workflow:

  • Trigger: WooCommerce Order Paid

  • Actions:

    • Add customer to FluentCRM
    • Send order details to Google Sheets
    • Notify your team on Slack

In this case, FlowMattic continues executing the workflow step by step right after WooCommerce fires the action of order paid. This does not add any delay to the order processing while the workflow continues its execution.


Case 2: WordPress Plugin–Based Triggers (Partially Synchronous)

Some triggers rely on WordPress action hooks that expect a response before the page load or request is completed. For example:

  • Trigger: Form submission from a plugin (e.g., WPForms, Contact Form 7)

  • Actions:

    • Add data to Google Sheets
    • Send a webhook to an external service

Here’s what happens:

  • The workflow runs in the same PHP session as the form submission.
  • This means the form processing waits a few seconds until the workflow finishes.
  • Typically, this adds only a 2–5 second delay and then the session completes.

How to Make These Workflows Fully Asynchronous

If you want the workflow to run completely in the background:

  • Add a “Delay” step of 1 minute right after the trigger.
  • This ensures the trigger is captured immediately, then the workflow continues in the background queue without blocking the main process.

Case 3: Incoming Webhook Trigger (Fully Asynchronous)

When FlowMattic receives data from an external app via a webhook:

  • The webhook immediately acknowledges receipt to the external service.
  • The full workflow runs in the background, independent of the sending system.

This ensures fast acknowledgment and smooth execution for your automations.


Why This Matters

  • Improved Performance: Most workflows run in the background, so your site stays fast.
  • Scalability: Handles many triggers without slowing down WordPress.
  • Flexibility: Even in synchronous cases, you can configure a simple delay to make them asynchronous.

Technical Notes

  • Workflows use WordPress background processes (via WP Cron or system cron).
  • Plugin-based triggers may briefly run synchronously but are short-lived (per PHP session).
  • Adding a Delay step right after the trigger is the best practice for ensuring async execution.

FAQ

Q1. Why does my form take a few seconds longer to submit when a workflow is running?
This happens because some WordPress plugin triggers run synchronously. The form waits until the workflow completes in that PHP session, usually only a 2–5 second delay. To avoid this, add a 1-minute Delay step after the trigger.

Q2. Will asynchronous workflows slow down my WooCommerce checkout?
No. WooCommerce order triggers are handled asynchronously, so your checkout remains smooth and fast. The workflow runs in the background while WooCommerce processes the order normally.

Q3. If I use Webhooks, will the sending service have to wait until the workflow finishes?
No. Webhooks are fully asynchronous. FlowMattic immediately acknowledges receipt, and the rest of the workflow runs in the background.

Q4. Do I need to set up Cron for asynchronous workflows to work reliably?
Yes. For the best performance, we recommend setting up a proper server-level system cron. WordPress’s built-in WP-Cron works too, but a system cron ensures more reliable background task execution.

Q5. Can I control how long workflows take to run?
Workflow speed depends on the number of steps and the response time of external apps. Even in asynchronous mode, heavy workflows may take a few extra seconds, but this won’t affect your website visitors or sending apps.


Summary

FlowMattic workflows are asynchronous by design, but some WordPress plugin triggers can run synchronously for a few seconds due to how WordPress hooks work. If you want to avoid even that small delay, simply add a 1-minute Delay step after the trigger to shift the rest of the workflow fully into the background.

Whether triggered by WooCommerce, webhooks, or other apps, FlowMattic ensures your automations run reliably and efficiently.

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