Race Conditions in Workflows (Unexpected Behavior)

Jan//Apprezo
Written by Jan//ApprezoLast updated 1 year ago

In rare cases, race conditions may occur when two processes update a contact’s status almost simultaneously. One process might update the contact, only for another to overwrite that update immediately after. This can result in issues like duplicate messages or actions showing as completed but not reflecting in the contact’s profile. Race conditions can also lead to loop lockouts and other unexpected behaviors in workflows.

Important: Preventing Race Conditions in Triggers

To avoid situations where a contact might be enrolled in multiple workflows simultaneously due to race conditions, Advisor's Growth now ensures that only one entry for a contact is processed at a time. This update prevents duplicate workflow executions, improving the overall reliability and accuracy of your automation processes.

Note: This updated functionality does not apply to appointment, invoice, and IVR triggers, where re-entry checks are not implemented. Refer to the Loop Lockout article for more related details.


Common Causes of Race Conditions

  • Multiple triggers for the same action: When different triggers execute simultaneously for the same function, conflicts can arise.

  • Simultaneous actions: When multiple actions for the same contact are executed at the same time, unexpected results can occur.

  • Timing overlaps in automations: If automation actions for a contact happen too closely together, race conditions may develop.


Examples of Race Conditions

  1. Appointment Triggers: Using both the "Appointment Status" and the deprecated "Customer Booked Appointment" triggers can cause conflicts.

  2. Simultaneous Opportunity and Appointment Triggers: When these triggers are in the same workflow and fire off simultaneously, problems may arise.

  3. Tagging in Multiple Workflows: Adding a contact tag at the same time in multiple workflows can result in a race condition.


How to Identify a Race Condition

  • Workflow Execution History: Investigate execution history and timestamps to see if two actions overlap.

  • Duplicate Messages or Actions: Look for instances where messages or actions are duplicated or appear out of sync with expected behavior.

  • Unexpected Results: If workflow actions seem to execute but don't update the contact properly, this may indicate a race condition.


Preventing Race Conditions

  • Add a Wait Step: Insert a 2-minute wait step before actions that may cause conflicts. This delay allows the system to process one action fully before moving to the next.

  • Avoid Duplicate Triggers: Ensure that the same or similar triggers aren't used across multiple workflows for the same actions.

  • Use Specific Filters: Refine your filters to target specific actions and avoid overlap.

  • Monitor Timing: Watch the timing of your triggers to prevent simultaneous executions.

  • Pass Input Trigger Parameters: When adding a contact to another workflow, use the "Pass Input Trigger Parameters" option to ensure correct data is passed.


Handling Unexpected Behavior

  • Check Enrollment History: Review workflow logs and enrollment history to identify timing or execution issues.

  • Adjust Timing: Add wait steps to mitigate timing conflicts and ensure smoother workflow execution.

  • Verify Trigger Setup: Make sure the correct triggers and actions are configured and that data passes between workflows correctly.


Best Practices and Troubleshooting

  • Use Unique Trigger-Action Pairings: Avoid using the same or similar triggers across multiple workflows for the same actions.

  • Consolidate Workflows: Where possible, use a single workflow for related actions to prevent conflicts.

  • Test Workflows Regularly: Regular testing can help identify race conditions and ensure workflows run as intended.


Did this article help you solve your issue?

Apprezo Helpdesk - Help Center

© 2026 Apprezo Helpdesk - Help Center. All rights reserved.