[Design Discussion] Runtime User Disambiguation in Identifying Executor #2215
DonOmalVindula
started this conversation in
Design
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Related Feature Issue
#2019
Problem Summary
The identifying executor expects exactly one user to match the provided identifiers. When multiple users share the same identifier (e.g., two users with the same username), the executor fails with a generic error. There is no mechanism to resolve this ambiguity at runtime by prompting the user for additional distinguishing attributes.
High-Level Approach
identify(current behavior, default) andresolve(disambiguation-enabled).resolvemode, when multiple users match, the executor returnsExecUserInputRequired(triggering theonIncompleteflow path) instead of failing.onIncomplete, input accumulation, executor modes).Architecture Overview
Executor Modes
identify(default)resolveonIncompletepath to collect additional attributes.Not specifying a mode falls back to
identify. Existing flows remain unaffected.Disambiguation Lifecycle
Key design decisions:
Attributes(json.RawMessage) and comparing against new inputs.Flow Definition Structure
The flow author wires disambiguation using existing flow primitives —
TASK_EXECUTIONnodes withonIncompleteedges toPROMPTnodes:{ "id": "identify_user", "type": "TASK_EXECUTION", "executor": { "name": "IdentifyingExecutor", "mode": "resolve", "inputs": [ {"identifier": "username", "type": "TEXT_INPUT", "required": true} ] }, "onSuccess": "next_step", "onIncomplete": "prompt_disambiguate" }{ "id": "prompt_disambiguate", "type": "PROMPT", "prompts": [{ "inputs": [ {"identifier": "firstName", "type": "TEXT_INPUT", "required": true} ], "action": {"nextNode": "identify_user_2"} }] }{ "id": "identify_user_2", "type": "TASK_EXECUTION", "executor": { "name": "IdentifyingExecutor", "mode": "resolve", "inputs": [ {"identifier": "username", "type": "TEXT_INPUT", "required": true}, {"identifier": "firstName", "type": "TEXT_INPUT", "required": true} ] }, "onSuccess": "next_step", "onFailure": "error_node" }Each identifying executor node declares its own set of inputs. The flow engine's existing input accumulation (
prepareContextmerge) ensures all previously submitted inputs are available to subsequent nodes.What the flow author controls
onFailureon the final executor node)Leveraging Existing Flow Engine Capabilities
This design requires no changes to the flow engine:
ExecUserInputRequired→onIncompletepathprepareContext()ctx.ExecutorMode)ctx.NodeInputs)Store Layer: Differentiating 0 vs >1 Results
Currently
IdentifyUserreturns a generic error for both "0 results" and ">1 results". This design introduces:ErrAmbiguousUsersentinel error for the >1 case (in existingIdentifyUser)SearchUsersmethod that returns full user objects for all matches (used by resolve mode)The existing
IdentifyUserremains unchanged in signature and behavior for all current callers.Frontend Flow Builder
The flow builder UI needs to:
identifyandresolve(following the existing pattern used by SMS OTP and Passkey executor mode dropdowns)onIncompleteedge wiring already work with the existing builder UISecurity Considerations
Questions for Discussion
resolvemode support a fallback behavior when all configured disambiguation steps are exhausted but ambiguity persists (e.g., configurable error message)?Beta Was this translation helpful? Give feedback.
All reactions