Need Help with AEM Approval Workflow Initiator
Hello there,
I'm currently working on an AEM Approval Workflow, and I've hit a bit of a roadblock. I'm struggling to properly set up the initiator, and I could use some assistance.
Here's a breakdown of my workflow:

The Manager Approval task is a custom implementation of ParticipantChooser, where I retrieve the workflow initiator using:
String initiator = workItem.getWorkflow().getInitiator();
Afterward, I identify all the groups this user belongs to and match the author group to the approval groups. This part works smoothly when I manually start the workflow.
However, my goal is to streamline the process for authors by triggering the workflow automatically when the authors publish content using a launcher.
Here lies the issue: when the launcher triggers the workflow, the user is set to "workflow-service" which prevents me from finding the correct approvers.
I tried using the metadata
String initiator2 = workItem.getWorkflowData().getMetaDataMap().get("userId", String.class);
* Get workflow history */
final List<HistoryItem> histories = workflowSession.getHistory(workItem.getWorkflow());
/* Get last item in workflow history */
final HistoryItem lastItem = histories.get(histories.size() - 1);
/* Get the user that participated in the last item */
final String lastUser = lastItem.getUserId();