I have the below questions related workflows on AEM 6.4
1. If Im having workflow models as part of the code, should I have the model code both in '/conf and /var(runtime model) locations in my codebase.
2. If Im triggering a workflow programatically, which location is to be used to get the modelId in order to get the workflow that is to be triggered
here you go
find more details at Adobe Experience Manager Help | Common Repository Restructuring in AEM 6.4
I also encountered this issue in AEM 6.5. The official documentation is not very helpful when talking about how to get your custom workflow into the system.
From a UX point of view it's not good that you have to open a default workflow and change the URL in the browser's address to your custom model.
Also I was not able to find that "sync button" mentioned at the 3. point when I have a workflow model open in the editor.
The 4. point kind of points at duplicating your custom workflow to "/config/settings/workflow/models/dam/my_workflow_model" and "/var/workflow/models/dam/my_workflow_model", but it's not explained why that's necessary.
1. Yes, In both the locations , the one under /conf serves as a template and the one under the /var is the real workflow instance which runs in the system.
2. for triggereing the workflow programatically, you need to mention the path under /var, Since the one under /var is the actual workflow running in the system.