Thanks and it can be achieved using custom policy/Subjourney/rest api to validate the user existence by Graph or rest api call and then based on conditional value check then call either signup policy technical profile to create user or call graph api or rest api to delete current user. There is subjourney steps you can use for more robust.
Please find below reference :-