Here is an article on how we can implement a requirement where we want to automate the initiation of the AEM workflows in any servlet with some piece of code. So here we will see how to locate the workflow in the CRX and using the same path we can start the workflow with the use workflow session.
So to start with we will decide which workflow we want to initiate in the servlet. Lets go to http://localhost:4502/libs/cq/workflow/content/console.html and lets say we will automate Download Asset workflow.
So here if we want know the model of this workflow then the value given in the ID column will be our workflow model path.
So now in our Servlet we need payload path and the workflow model. payload path is the path to the node which we want to run workflow on.