How to get lastmodifiedby field updated with cms user name, rather than "system" user?

Hello,
Scenario-1:
I have written a Daemon Event handler to fetch details from external system and update details once cms user clicks on Save and Done.
With WorkflowManager when I update the document “last modified by” field gets updated to “system”. I want to change it to cms user name.
Please suggest.

Scenario-2
To fix above issue, I have created a jvm user and updating the nodes with jvm user session without workflow manager and its much faster updating documents, also last modified by showing as CMS user.
but here documents immediately dont reflect changes once its updated, we have to do page refresh.

Please suggest what would be better approach and how to get through the issues with them.

I suppose the question would have to be, what user do you want to be recorded? The user id of the session will be used by default. Now if you want it to be the user who initiated the event, you would need to create a session with that user id.

Not using the workflowmanager is possible. However, there is of course extra work done by the workflowmanager such as updating the last modified by. It’s probably fine, but you’ve already noted some deficiencies, such as having to reload.