What is a race condition?
A race condition happens when the outcome of a workflow depends on the timing of events rather than their logical order. In the HoopAI platform, this typically occurs when:- Multiple triggers fire simultaneously for the same contact
- Two workflows attempt to update the same contact field at the same time
- A single action triggers multiple downstream processes that conflict with each other
Common causes
Overlapping triggers
Using both the Appointment Status trigger and the Customer Booked Appointment trigger for the same workflow logic can cause two executions to fire at once.Simultaneous workflow enrollments
When a contact’s action (such as submitting a form) enrolls them in multiple workflows that modify the same fields, updates can collide.Tag-based conflicts
Adding or removing tags across multiple workflows at the same time can result in tags not being applied or removed as expected.Opportunity and appointment triggers firing together
If an opportunity status change and an appointment trigger fire within milliseconds of each other, both workflows may attempt to process the contact simultaneously.How to identify race conditions
Look for these symptoms in your workflow execution logs:- Duplicate messages sent to the same contact
- Workflow history showing a different trigger than the one you expected
- Tags not reflecting on the contact record despite the workflow completing successfully
- Skipped or out-of-order steps in the execution path
Check execution logs
Navigate to the workflow and open the Execution Logs tab. Filter by the affected contact and review the timestamps of each action.
Compare workflow timing
If the contact is enrolled in multiple workflows, compare the enrollment timestamps across workflows. Look for enrollments within seconds of each other.
Prevention strategies
Add a wait step
Insert a short wait step (1 to 2 minutes) before actions that are likely to conflict. This gives the system time to process prior updates before executing the next action.Use distinct triggers
Avoid using the same or overlapping triggers for the same actions across multiple workflows. Choose one trigger per event and consolidate your logic into a single workflow when possible.Apply specific filters
Use precise filters on your triggers so that only the exact conditions you intend will fire the workflow. Broad filters increase the chance of multiple triggers activating at the same time.Pass input trigger parameters
When using the Add to Workflow action to move a contact between workflows, enable the Pass Input Trigger Parameters option. This ensures data is carried forward correctly and reduces the chance of conflicting updates.Consolidate related workflows
If you have multiple workflows that react to the same event, consider merging them into a single workflow with branching logic (If/Else conditions). This eliminates the possibility of simultaneous, competing executions.Best practices
| Practice | Why it helps |
|---|---|
| One trigger per event | Prevents duplicate workflow executions |
| Wait steps before critical actions | Allows prior updates to complete |
| Specific filters on triggers | Reduces unintended activations |
| Consolidated workflows | Eliminates cross-workflow conflicts |
| Regular log reviews | Catches race conditions early |
FAQs
Can race conditions cause data loss?
Can race conditions cause data loss?
Race conditions typically do not cause data loss, but they can result in incorrect data being written to contact records. For example, one workflow may overwrite a field value that another workflow just updated.
Will adding wait steps slow down my workflows significantly?
Will adding wait steps slow down my workflows significantly?
A 1 to 2-minute wait step adds minimal delay and is usually unnoticeable to your contacts. The reliability gains far outweigh the small time cost.
How do I know if my issue is a race condition or a different bug?
How do I know if my issue is a race condition or a different bug?
Race conditions are characterized by intermittent, timing-dependent failures. If the same workflow works sometimes but fails other times with no configuration changes, a race condition is likely. Consistent failures usually point to a configuration issue instead.
.png?fit=max&auto=format&n=EQK5eX9kTD8NzWwA&q=85&s=878008bf159fcc4964d0c0d508b6e400)