Forum Discussion

Selman_Balci's avatar
Practitioner II
5 months ago

Race Condition Issue between API-trigger and mail execution during Registration

Hello people,

I have this interesting case which looking for a proper solution that wont affect the UX during onboarding.

When user completes the registration process, we send a service mail with a verification link that users can verify their email addresses.

Service mail is set as API-triggered campaign and we have this race problem that sometimes the API call is prior to mail execution which gives an error: "User can't found"

Our campaign flow for user creation process on Braze contains 2 steps:

1- API call to create a ghost user (using alias and email address attribute only) to create user profile

2- API call to find the user profile and trigger the email send

3- when user clicks and verify mail --> actual user profile is created with all attributes.

4- API call to merge these user profiles.


Between step 1 and 2, API call to find user data for executing email fails.


Any user case or solution with this issue above? Support suggesting to add more delay between API calls to not face race condition, however registering a service and wait 3-4 minutes of 1st email for verification is not match with our UX flow.


Thanks in advance

No RepliesBe the first to reply