Hi Descope team! Quick architecture question about...
# ask-a-descoper
s
Hi Descope team! Quick architecture question about Descope Flows: Is there a way to check whether a user exists (based on an entered email) and branch the flow before triggering any authentication step (OTP, password, etc.)?
🙏 1
Context: We’re building a unified onboarding + login flow (see flow here: https://app.descope.com/flows/builder/amaebetter-patient-flow-new) • New users → Email + password → WebAuthn enrollment (or OTP fallback) • Returning users with WebAuthn → Instant WebAuthn login (no OTP first) After collecting the email, I don’t see a clean way to determine “user exists vs not” without triggering authentication. I explored using a Condition node for this but couldn’t find a way to check user existence prior to auth. If we require OTP first, returning users who already have WebAuthn end up doing two auth steps, which breaks our intended WebAuthn-first UX. Is there a recommended pattern for handling this in a single flow?
cc @Noel @Alda Pontes
🙌 1
c
Something like a condition for
unauthUser.userId is not empty
image.png
s
Hi @Chris Carper, thank you for the suggestion. Just to clarify: my understanding is that
unauthUser.userId
only becomes populated after an authentication-related step runs (e.g., OTP, password, OAuth, etc.), correct? In our case, we’re trying to branch immediately after an email input screen, before triggering any authentication step. At that point in the flow, we only have
form.email
, and
unauthUser
hasn’t been resolved yet (as far as my understanding goes). So the condition would always evaluate as empty until after something like OTP or password runs. The reason this matters is that for returning users who already have WebAuthn enabled, we want them to authenticate instantly via WebAuthn only, without forcing an OTP step first just to determine existence. So I think the core issue is that we’re trying to branch on user existence prior to authentication, and I’m not sure whether that’s supported within Descope Flows?
c
unauthUser items do populate before the auth method has been completed. See attached example flow
n
Moving this discussion to a new thread to avoid confusion: https://authtown.slack.com/archives/C04490U8M7A/p1771853612735489