Good afternoon,
I tested this expression:
"GetUser($currentPortal, LastRunner($Job, "<step ID>"))['email']"
and it works.
But when I add it to an email step in the text box To or CC it does not accept the value and shows a message "Invalid email".
I see that you have already wrapped the arcade expression in double quotes.
According to ESRI documentation, the To/CC fields accept expressions only when inserted via the “This input supports Arcade Expressions” option; otherwise, they’re treated as plain text and flagged as invalid.
In practice, the reliable workaround is to resolve the value first (e.g., store the email in a job property) and then reference that property in the Email step.
Dynamic job properties—ArcGIS Workflow Manager | Documentation
Add and configure Send Email—ArcGIS Workflow Manager | Documentation
Found the issue.