Unwanted double firing of the same WF

Suppose there’s a WF that runs when Condition A = True. The WF is made of a few steps. One of them sets Condition A = False.

A problem I’m having from time to time in different WFs with the above structure is that the same WF fires twice. In particular:

  • T1: The Condition A is True and the WF fires. Let’s call this run “Run1”. It will take a few milliseconds before it reaches the step where it sets Condition A = False

  • T2: Run1 has not yet reached the step where it set Condition A = False, therefore Condition A is still True and the same WF fires again (“Run2”).

Is there a way to avoid Run2 if Run1 is still running?
Thanks in advance.

Share the screen shots of your setup for the workflows…so many different ways to approach a setup that it is helpful for others to see what you did to help you figure out how to resolve for the issue.

1 Like

There it is

The WF is supposed to trigger when a logged out user reaches the onboarding page for signing up to my service.

If the user opens that page and is logged out, the WF fires.
At step 3 a new account is automatically created with email userid@mydomain.com, (e.g. 1714873340413x788954091356904000@mydomani.com).
At step 4 the user gets logged in.

My problem is that while this WF is still running its firs run (“Run1”) for a few milliseconds the condition “user is logged out” is still true and the same WF fires again (“Run2”).

When Run2 reaches step3 , it causes the errore USED_EMAIL as it is attempting to create an account with the same email used by Run1.

The same problem happens to me in other similar circumstances.

step 2 is setting a state value, what is it?

The trigger itself is a conditional trigger, is it set to run once or run everytime?

Where in your workflows is another action to set the same state you are setting in step 2?

it simply sets a state equal to a parameter in the url. If it’s empty it is going to be empty:

It’s a “user is logged out” type trigger:

there is no option to make it run once or every time and I guess the latter applies. There is also an additional condition:

Nowhere else:
Screenshot 2024-05-05 alle 15.19.35

Why not change the event to a ‘When condition is true’ event, set to only run once…

That should prevent it from running twice.

as mentioned you could try changing the type of trigger used.

You could also use a condition based on a custom state. The condition would be on the trigger and reference the custom state value which could be a yes/no…then in the first step before you show the popup you could switch the value of the custom state so the condition on the trigger would no longer evaluate as true.

Or instead of bothering with custom state, just use a condition that is the ‘popup loading screen is not visible’ which when you run step 1 to show the popup would make the condition evaluate to no and not fire again.

This topic was automatically closed after 70 days. New replies are no longer allowed.