I have created a workflow. Added the workflow and workflow path in the filter.xml as
<filter root="/apps/settings/workflow/notification/email/content-review" mode="update"/>
but every time I deploy the code, the workflow doesn't sync automatically. It has to synced manually. Is there any way to make it sync automatically? should I use different mode?
The reason of the issue is the fact that you are keeping your workflow model under incorrect path. According to Adobe documentation, you should use below 2 location:
To solve your issue, you should move your model under /conf location, but also use /var. In other words your package should keep both design model and runtime model. This will assure that you will not need to do any sync after deployment and your workflow model will be always up to date.
Your filter could look like this (assuming you have your workflow model design and runtime version under appropriate paths)
<filter root="/conf/global/settings/workflow/models/your-workflow-model"/> <filter root="/var/workflow/models/your-workflow-model"/>
Hi @lukasz-m ,
Sorry. The path I have used is this
<filter root="/conf/global/settings/workflow/models/awsevents" mode="update"/>
<filter root="/var/workflow/models/awsevents" mode="update"/>
above I have given wrong path. After giving the correct path not able to sync the workflow.
I dont think that its a good approach to put runtime models in the codebase:
The runtime model should be synced in each instance as it is a one time activity.
There is no additional step for you to automatically sync up the workflow when deployed. I did try the same on AEM 6.5.0 and I see the workflow is in sync state. Can you try just by overriding the model, by using belwo one. Just remove the mode update completely and try:
<filter root="/conf/global/settings/workflow/models/awsevents"/> <filter root="/var/workflow/models/awsevents"/>
Ideally, it should work, can you try syncing in your local and package model again from both var and conf folder and deploying using the below filters
After package deployment a sync needs to take place so it is correctly located under /var/workflows which is where the active workflows are placed.
Also as others also commented, having a duplicate is not good.
Here is where you place your workflows:
Here is how you sync the Dam Update Assets workflow after deployment:
curl -X POST -u admin:admin http://localhost:4502/conf/global/settings/workflow/models/dam/update_asset/jcr:content.generate.jso...