Skip to main content
Level 2
Sep 13, 2024 7:23 PM UTC
Question

How to get current logged in user details in workflow process step

I tried to get current logged in user using session and authorizable. But none of them giving the current user.

Is there any other way to get the current user details ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

6 replies

DPrakashRaj
Community Advisor
Community Advisor
Sep 13, 2024 8:32 PM UTC

Are you referring to initiator of the workflow user if that’s the case then please refer to https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/is-it-possible-to-get-the-current-user-in-the-workflow/m-p/446998

current user can be found from session object 

session.getUserID();

I am not sure what’s the use case you have to get the current use in workflow process step and I believe in workflow you work with workflow session and not the current user session.

Translate
Level 2
Sep 14, 2024 1:59 AM UTC

Hi,

I need to check initiator and approver are same user or not. 

 

session.getUserID()

will return workflow-service user id not the user who logged in. 

Translate
joerghoh
Adobe Employee
Adobe Employee
Sep 15, 2024 9:21 AM UTC

A workflow process step is a piece of code, which runs in the background. For that it is not bound to a HTTP request and also not to a user in the first place. 

That means that in a process step the concept of a "current user" simply does not exist.

Translate
kautuk_sahni
Level 9
Sep 25, 2024 12:30 PM UTC

@manikandan90 Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Translate
Kautuk Sahni